Able to detect disconnect, except one weird case...
- From: eselk2003@xxxxxxxxx
- Date: Sat, 3 May 2008 10:26:27 -0700 (PDT)
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.
.
- Follow-Ups:
- Re: Able to detect disconnect, except one weird case...
- From: Volodymyr M. Shcherbyna
- Re: Able to detect disconnect, except one weird case...
- Prev by Date: Re: wireless networking in managed code
- Next by Date: Slow registration of group name NetBIOS
- Previous by thread: wireless networking in managed code
- Next by thread: Re: Able to detect disconnect, except one weird case...
- Index(es):
Relevant Pages
|
|