Re: Question about howto do proper timeout checking on connections
From: Alun Jones [MSFT] (alunj_at_online.microsoft.com)
Date: 06/30/04
- Next message: Arkady Frenkel: "Re: Wireless LAN SDK"
- Previous message: Stephan Wolf [MVP]: "Re: To change Wireless Zero Configuration settings"
- Next in thread: Onemangang: "Re: Question about howto do proper timeout checking on connections"
- Reply: Onemangang: "Re: Question about howto do proper timeout checking on connections"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 29 Jun 2004 17:39:03 -0700
"Onemangang" <theonemangang@hotmail.com> wrote in message
news:uL2ZR2cXEHA.1656@TK2MSFTNGP09.phx.gbl...
> Setsockopt returns zero, indicating that the so_rcvtimeo was
> set sucessfully. I used a timeout of 2500 ms to test this.
Implementing your own timeouts is a better way of doing this, because you
can include the timeout processing in your regular worker thread pools. I
don't know if so_rcvtimeo is supported for all non-blocking sockets, but the
documentation for setsockopt does state that so_rcvtimeo is supported for
recv(). You are using WSARecv().
On the topic of the way you're timing out, why not simply build a sorted
structure (a list or something), on the basis of how soon the socket will
time-out? Each time data is received or sent on a socket, just pump it to
the end of the list, and when it's time to check for timeouts, you just
remove those sockets at the front that are timed out, and don't search if
the front socket isn't ready to be timed out. And you use the timeout value
of the first socket as being the next time to wait.
Alun.
~~~~
- Next message: Arkady Frenkel: "Re: Wireless LAN SDK"
- Previous message: Stephan Wolf [MVP]: "Re: To change Wireless Zero Configuration settings"
- Next in thread: Onemangang: "Re: Question about howto do proper timeout checking on connections"
- Reply: Onemangang: "Re: Question about howto do proper timeout checking on connections"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|