Tcp Socket Closed

Posted by Michael Covelli on Stack Overflow See other posts from Stack Overflow or by Michael Covelli
Published on 2010-03-11T21:26:36Z Indexed on 2010/03/11 21:29 UTC
Read the original article Hit count: 282

Filed under:
|

I always thought that if you didn't implement a heartbeat, there was no way to know if one side of a TCP connection died unexpectedly. If the process was just killed on one side and didn't exit gracefully, there was no way for the socket to send FIN or let the other side know that it was closed.

(See some of the comments here for example http://www.perlmonks.org/?node_id=566568 )

But there is a stock order server that I connect to that has a new "cancel all orders on disconnect feature" that cancels live orders if the client dis-connects. It works even when I kill the process on my end, and there is definitely no heartbeat from my app to it.

So how is it able to detect when I've killed the process? My app is running on Windows Server 2003 and the order server is on Suse Linux Enterprise Server 10. Does Windows detect that the process associated with the socket is no longer alive and send the FIN?

© Stack Overflow or respective owner

Related posts about tcp

Related posts about socket