Board index » delphi » How to see if a TCP connection is gone down

How to see if a TCP connection is gone down


2004-08-09 06:06:06 PM
delphi123
Hi all,
I've tried to make a client server application with indy (i started with the
zipcodelookupdemo in delphi6) and all has gone well since i write a stream
from the client to the server (or viceversa) and I plug the net cable off
(to test what appen if the network goes down) , the client does nothing and
I can not close it (waiting for something) without any error showing.
How can I intercept such a problem ??
 
 

Re:How to see if a TCP connection is gone down

"luca gallo" <XXXX@XXXXX.COM>writes
Quote
I've tried to make a client server application with indy (i started
with the zipcodelookupdemo in delphi6) and all has gone well
since i write a stream from the client to the server (or viceversa)
and I plug the net cable off
What OS are you using? Not all versions of Windows like having the network
cable physically removed. It can lock up the machine under certain
circumstances. Even then, the WinSock API has no way of knowing that the
cable is pulled anyway, so active operations will enter into blocking status
until internal timeouts occur (which can be a long time since WinSock is
designed to internally handle network outages and reestablish connections
when the network is restored - assuming the OS isn't locked up first).
Gambit