Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: TTcpServer

www.cryer.info
Managed Newsgroup Archive

Re: TTcpServer

Subject:Re: TTcpServer
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 13 Dec 2006 20:04:50

"Roberto Colpani" <roberto.colpani@vetrariafratellicolpani.it> wrote in
message news:45803cb7@newsgroups.borland.com...

> I try to write a program with the TIDCmdTCPServer and the TIDTCPClient
> to mimic the older TTCPClientSocket and TTCPServerSocket but I have
> very bigs problems to understand how mimic the older component.

What EXACTLY are you having a problem with?

> The big trouble is that I use the client sndCmd to send my command,
> the server send the reply but also must inform the other user of some
> kind of operation.

Please elaborate.

> On the client side this is done from a Listener thread that in a loop
> continually read the IOHandler.ReadLn. And this is the bug the I can't
> resolve.

You can't use SndCmd() if you have a reader thread.  The thread will
potentially read the data that SendCmd() is waiting for, and vice versa.
You will have to use WriteLn() instead and then let the reader thread handle
the response.  Otherwise, you can't use a reader thread at all.  You will
have to use a timer instead that reads when the client is not busy waiting
for a reply.

> Can I use the TTCPServer and TTCPClient componet from the internet
> page of the palette?

I strongly advise NOT using those components.  They are very poorly written.
They are Borland's attempt at cross-platform sockets, but they are
implemented to very simple common demoninators between multiple platforms,
which means that they have very little actual functionality implemented at
all, thus requiring a lot of extra coding on your part.

> They are robust as the indy component?

Not even close.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive