BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detecting Client disconnect

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Roberto Meneghini
Guest





PostPosted: Tue Sep 26, 2006 2:45 am    Post subject: Detecting Client disconnect Reply with 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
Jamie Dale
Guest





PostPosted: Tue Sep 26, 2006 3:00 am    Post subject: Re: Detecting Client disconnect Reply with quote



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





PostPosted: Tue Sep 26, 2006 3:33 am    Post subject: Re: Detecting Client disconnect Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.