We have a windows form application and it communicates to a backend UNIX server using socket communication.
Some of the application users are facing a strange problem. If the application is left idle for some time(2-4 hours), the application disconnects the socket and by verifying the logs, we see following errors.
"An existing connection was forcibly closed by the remote host".
I do not see any coding in the Windows form that suggests that there is a time interval after which it will break the sockets and it works perfectly fine if I keep my application idle for 24 hours.
I have already verified that there is no firewall between the user PC and the server to which he is connecting to. Is there any other reason/area I should verify?
I'd crack out my network sniffer and see where the disconnect comes from on the wire. See whether there is a RST from the remote end, or the local end, or something else. Perhaps use http://blogs.technet.com/b/netmon
I can't think of anything in .NET that would close it -- assuming you've help a reference to the socket/etc and the Finalizer isn't waking and finalizing it... :-)
http://www.alanjmcf.me.uk/ Please follow-up in the newsgroup. If I help, mark the question answered
I may try to use the network Monitor tool to see if this gives me any help.
It may not be caused by your code.
In some configurations, network equipments may drop idle connections.
You may check or get help to check network equipment configurations.
You already get the error "An existing connection was forcibly closed by the remote host".