Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: Should TidTCPServer (Indy 9.0.10) automatically disconnect all clients when
| Subject: | Re: Should TidTCPServer (Indy 9.0.10) automatically disconnect all clients when |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 15 Nov 2007 10:19:27 |
"Serge Kravchenko" <support@truecafe.net> wrote in message
news:473c3757@newsgroups.borland.com...
> To my surprise, the client remains connected
> (TidTCPClient.Connected = True):
Was any data sent to the client before you shut down the server? Did the
client perform any reading/writing operations? The Connected() method is
not a true real-time status of the socket's current state. If there is any
unread data in the InputBuffer, Connected() will continue to return true
even if the socket was closed, allowing the receiver to finish processing
any pending data it needs. If no reading/writing operation is performed at
all, then the underlying socket is not accessed, and Indy cannot react to
the OS reporting that the socket was closed.
> Should the server disconnect all connected clients?
Yes. But depending on what the rest of your code is doing, the client might
not react to it right way, even though it was closed on the server side.
Gambit