Hello everyone~
I have a problem to solve~
I have created a server that every one can connect to this server.
The function of The server is in order to transfer message from one client to another client.
I don't known when the other client send the message to the client.
I use Delphi-7 to develop the program.
I didn't find any TCPClient object to listen the message which the TCPServer send.
Please give me your point of views~thanks :)
Asked
Active
Viewed 2,049 times
1

solar
- 335
- 2
- 6
- 13
-
you've mentioned a problem in title, but there's no question in your post. From your description it sounds to me you're looking for a TCP/IP component for Delphi 7. If so, then try to look at [this post](http://stackoverflow.com/questions/5709127/wiki-current-state-of-the-art-of-delphi-3rd-party-tcp-ip-components-libraries). – May 24 '11 at 08:52
-
1Oh~I'm sorry that I explain my question ambiguously.My question is that I don't know when the TCPServer send the message to the TCPClient,because the client doesn't know when the other client send the message to you,so I don't know when the TCPClient receive the data.Thank you for your reply~ – solar May 24 '11 at 09:00
-
If you are talking about receiving a response from the server you can just call the Indy functions to receive the response. They are all blocking so they will only return once the response has been received (or a timeout has occured). Indy handles all the timing for you this way. – jpfollenius May 24 '11 at 10:04
-
https://forums.embarcadero.com/message.jspa?messageID=160122 has an example using TWinSocketStream.Create(TcpClient.Socket, 1000); – mjn May 24 '11 at 11:08
1 Answers
1
Servers don't initiate conversations with clients. If your messaging clients don't already have open connections with the server, and the server needs to notify the client that it has a message, then the client program needs to have a server component so that it can listen for new connections from the message server.
One alternative is for the clients to keep persistent connections open with the server. When a message arrives, the server can send a notification to the appropriate client because it already has a connection open and the client is waiting for a response from the server.

Rob Kennedy
- 161,384
- 21
- 275
- 467