views:

704

answers:

1

Is there any way in a Win32 environment to "tune" the timeout on a socket connect() call? Specifically, I would like to increase the timeout length. The sockets in use are non-blocking. Thanks!

+3  A: 

Yes, this is possible.

If you're in non-blocking mode after connect(), you normally use select() to wait till I/O is ready. This function has a parameter for specifying the timeout value and will return 0 in case of a timeout.

fhe