Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : Re: TIDTCPClient.

www.cryer.info
Managed Newsgroup Archive

Re: TIDTCPClient.

Subject:Re: TIDTCPClient.
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 13 Mar 2008 16:55:54

"Roberto Colpani" <roberto.colpani@vetrariafratellicolpani.it> wrote in
message news:47d9b60e$1@newsgroups.borland.com...

>  Result := IdTCPClient1.SendCmd('RegisterUser; AUser AComputerName');
>  Memo1.Lines.Add(IDTCPClient1.IOHandler.ReadLn);

SendCmd() receives the response from the server and puts it in the
LastCmdReply property for you.  You should no need to read a line manually,
unless your server's replies are not being formatted corrected.

> When i reClick the button I have an error that tell me the
> IDTCPClient is already connected;
> Why?

Because Indy thinks you are still connected to the server.  You can only
connect once at a time.  What is likely happening is that you are not
reading everything the server sends you, so the IOHandler's InputBuffer is
not empty.  Indy considers a connection to be active if reading operations
can still be satisfied.  You are probably also using an older version of
Indy 10 that does not clear the InputBuffer when making a new connection.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive