# Closing local TCP sockets



## bianster (Aug 20, 2010)

I come across instances where a TCP connection between a FreeBSD 7.2 server and a Win2k3 server becomes disconnected only on the FreeBSD end.  This happens for a reactor (Eventmachine) based application that I'm running. 

I'm trying to find a solution to this. Is there a way to simulate the closing of the network socket only on FreeBSD? So that the remote peer (win2k3) doesn't know that the socket has closed on the FreeBSD server.


----------



## gordon@ (Aug 20, 2010)

Is there a stateful firewall between the FreeBSD box and the Win2k3 box?


----------



## bianster (Aug 20, 2010)

No, there's no firewall on either server.


----------



## SirDice (Aug 20, 2010)

How about the network in between? It's quite possible the statefull firewall does allow the connecting but because there's nothing going over it for a period of time the state on the firewall times out and closes the connection. I've seen this happen many times.


----------



## bianster (Aug 20, 2010)

Hmm, the servers is on a home network with a Comcast router. I don't actually know for sure if there is any stateful firewall on the router itself as these servers are in a remote location 12 hours behind me. I'll like to consider the possibility that the router/firewall has a part in this though I don't quite understand why only one end is disconnected. The FIN/ACK packet doesn't get received somehow by the remote peer?


----------



## gordon@ (Aug 21, 2010)

It's quite possible to see this behavior with a stateful firewall sending an RST to one end. This would cause the FreeBSD box to kill the connection while the Win2k3 box thinks it is still connected (albeit with no traffic).


----------

