Re: TCP Client/Server

Giganews Newsgroups
Subject: Re: TCP Client/Server
Posted by:  Remy Lebeau \(TeamB\) (
Date: Wed, 18 Jun 2008

"Marius" <mari…> wrote in message

> Traffic over the connection will be initiated by both parties, e.g.
> the server might tell the client to do something or the client may
> tell the server to do something.

That kind of communication is a little complicated to implement if you use
Indy.  At best, you would need to implement an outbound queue for each
client on the server side, and use a dedicated reading thread on the client
side.  You would not be able to use the SendCmd() method on either end,

> I'm using D2006 Win32 and was thinking I'd use Indy10
> TCPServer and TCPClient. Is this the right way to go?

Depending on the particular nature of your protocol, yes.  If the server
were not sending commands to the client, then you could have used the
TIdCmdTCPServer component instead, or the TIdCmdTCPClient component if the
server were sending commands but not the client.  But because they both are,
you are best off using the basic TIdTCPClient and TIdTCPServer components so
you have more control overr the data.



In response to

TCP Client/Server posted by Marius on Tue, 17 Jun 2008