Simple Client-Server Data Transfer using TCP
Posted on 2003-11-05
I have never done socket programming. I want to create a simple application that has the following functionality:
I would like to have a controller (called System A) which can instruct all machines to do some task and return the result.
1) From system A, I want to send some string to another system (System B, whose IP address I know and which has perhaps this same program running)
2) On System B, I want to read the received string, do the necessary processing depending on what was sent, and send a reply back to the system A.
3) When system B sends a response, System A could save the response to a text file aling with the detail of the system that sent the response.
4) Also, if possible, I want to be able to broadcast a common message from system A to all systems that are running my application so that they could send a response back that System A can log.
I am very unfamiliar with TTcpServer, TTcpClient of Delphi 7 but intend to use these for my application. Ofcourse, if there are simpler ways to do this, then the suggestions would be welcome. If there are things I missed out in the requirements, please do point those out :-)
But I would need a very detailed explanation because I have to get the job done!