Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: Linger. TClientSocket. Server kicks me! :(
| Subject: | Re: Linger. TClientSocket. Server kicks me! :( |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Fri, 22 Dec 2006 12:59:06 |
"jordillussa" <jordillussa@yahoo.com> wrote in message
news:1166781722.085140.198110@42g2000cwt.googlegroups.com...
> The problem is that when I send a message to the server using my
> TClientSocket, the server answers me with a message and inmediately
> he closes the connection... the result is that I "catch" an error receive
> in a try except structure.
That is perfectly normal behavior.
> What should I do to avoid this "receive" error?
Why do you want to avoid it? It is a valid condition that you should be
handling.
In any case, inside your OnError event handler, set the ErrorCode parameter
to 0 to prevent the exception from being thrown. Your reading code will
then have to handle the condition where an error code may be returned from
the reading method, though.
> My code is like this;
You did not show any of your reading or error handling code.
Gambit
none