Able to detect disconnect, except one weird case...



I'm using winsock, with WSAEventSelect on the client side. I get
events correctly for FD_CLOSE, FD_CONNECT and FD_READ (the 3 I need).
Only problem is when my client sits silent with no data being
transfered for a long period of time (a couple hours maybe, never
timed it exactly), at that point the server knows the connection has
been closed, but the client doens't get the FD_CLOSE event (or
FD_READ) like it does when the server disconnects. First of all, I'm
not sure what is closing the connection, but I'm not really worried
about that (I imagine there are various timeouts at different levels,
maybe even the router and ISP levels)... as long as I can detect the
disconnect, that is all I care about.

On other projects I've sent keep-alive packets (just small packets
that my client/server ignores) every minute or so, which do keep the
connection open and also let me detect errors... but on this project
I'd rather not do that if I don't need to. I don't mind getting
disconnected every couple hours (or whatever the various timeouts are)
as long as I can detect it and reconnect.
.



Relevant Pages

  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • Re: $100 reward for socket disconnection help
    ... > I'm running Java 1.4.1 as an applet on the client side, under Windows 98, ... > with a DSL connection through a Linksys Wireless-B Router. ... > disconnects at the same time my application does ("AOL Instant Messenger ... > still trying to reconnect, IM is always able to immediately reconnect, and ...
    (comp.lang.java.programmer)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #2]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • Re: Able to detect disconnect, except one weird case...
    ... Only problem is when my client sits silent with no data being ... at that point the server knows the connection has ... FD_READ) like it does when the server disconnects. ... On other projects I've sent keep-alive packets (just small packets ...
    (microsoft.public.win32.programmer.networks)