Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jul : Re: Indy Examples sending messages between server and client
| Subject: | Re: Indy Examples sending messages between server and client |
| Posted by: | "D-Fan" (d-fan@antispam.com) |
| Date: | Wed, 9 Jul 2008 13:06:10 |
Thats fair enough. I have a few questions about approach and would
appreciate your input.
When should I use a Tidtcpclient v/s a Tidcmdtcpclient?
Does it make sense to send a header message stating the size of the
actual message to the server and then have the server issue a waitfor a
response of that size. This will make sure that the server receives the
entire message. If the full message is not received the server can
flush its buffer and reset itself.
Remy Lebeau (TeamB) wrote:
> "D-Fan" <D-Fan@antispam.com> wrote in message
> news:48730897$1@newsgroups.borland.com...
>
>> Are there any Indy examples using simple messages between a
>> a server pc and many client pcs.
>
> Numerous examples have been posted before. Go to http://www.deja.com and
> search the newsgroup archives.
>
>> The server will be using an Indy tcp server component and the
>> clients will use either a tcp server or a non server component.
>
> It has to be a TCP client component. A TCP server cannot comunicate with
> another TCP server.
>
>> The server needs to be able to send a message to the client at any time.
>
> That requires you to implement an asynchronous protocol in your
> communication. Clients have to poll the connection periodically in order to
> read unsolicited data packets. The packets themselves have to be formatted
> in a way that a client can differentiate between a server-initiated command
> and a reply to a client-initiated command.
>
>> This makes me think that the client PC needs to have an Indy server
>> component
>
> No. That is not how TCP works.
>
>> or perhaps a client component with a timer
>
> Yes, or a polling thread.
>
>
> Gambit