Socket connection breaking after the application remains idle for sometime(2-4hours)

Locked Socket connection breaking after the application remains idle for sometime(2-4hours)

  • 2011年1月3日 19:44
     
     
    Hi,

    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?

すべての返信

  • 2011年1月8日 11:42
     
     

    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
  • 2011年1月11日 17:54
     
     

    Thanks Alan,

     

    I may try to use the network Monitor tool to see if this gives me any help.

     

     

    • 回答の候補に設定 Teryaki 2012年3月19日 19:01
    • 回答の候補の設定解除 Teryaki 2012年3月19日 19:01
    •  
  • 2012年3月19日 19:05
     
     

    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".