 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Roberto Meneghini Guest
|
Posted: Tue Sep 26, 2006 2:45 am Post subject: Detecting Client disconnect |
|
|
Hello,
I'm writing a simple client/server application using INDY10's IdTCPServer
and IdTCPClient for Delphi 2006 .NET. Everything works well (connect,
disconnect, sending data back and forward).
Is there a way for the server to know that the client has lost connection?
Like the network cable was unplug or the computer crashed. I have tried
using "Connection.IOHandler.Connected" and
"Connection.CheckForGracefulDisconnect" but it always return positive even
if the client computer is no longer connected.
Any suggestions?
Thanks,
Roberto |
|
| Back to top |
|
 |
Jamie Dale Guest
|
Posted: Tue Sep 26, 2006 3:00 am Post subject: Re: Detecting Client disconnect |
|
|
Only thing you can do is a Keep-Alive type thing which you'd have to write
yourself.
J
"Roberto Meneghini" <rmeneghini (AT) separationsystems (DOT) com> wrote in message
news:45184e10$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello,
I'm writing a simple client/server application using INDY10's IdTCPServer
and IdTCPClient for Delphi 2006 .NET. Everything works well (connect,
disconnect, sending data back and forward).
Is there a way for the server to know that the client has lost connection?
Like the network cable was unplug or the computer crashed. I have tried
using "Connection.IOHandler.Connected" and
"Connection.CheckForGracefulDisconnect" but it always return positive even
if the client computer is no longer connected.
Any suggestions?
Thanks,
Roberto
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Sep 26, 2006 3:33 am Post subject: Re: Detecting Client disconnect |
|
|
"Roberto Meneghini" <rmeneghini (AT) separationsystems (DOT) com> wrote in message
news:45184e10$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Is there a way for the server to know that the client has lost connection?
|
The only way to do that is to use timeouts and keepalives in your own code.
There is nothing in the socket API itself (or in Indy) to detect lost
connections in a timely manner. This topic has been discussed many times
before. Please go to http://www.deja.com and search through the newsgroup
archives.
| Quote: | I have tried using "Connection.IOHandler.Connected" and
"Connection.CheckForGracefulDisconnect" but it always return
positive even if the client computer is no longer connected.
|
As they should be. Those methods are not meant to detect lost connections.
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|