http://tangentsoft.net/wskfaq/newbie.html#timeout
2.15 - How to change the timeout for a Winsock function?
Winsock (, connect()) -, . , , . , , , , ; .
- () recv() SO_SNDTIMEO SO_RCVTIMEO setsockopt()..
Winsock . -:
Non-blocking sockets with select() – The fifth parameter to the select() function is a timeout value.
Asynchronous sockets – Use the Windows API SetTimer().
Event objects – WSAWaitForMultipleEvents() has a timeout parameter.
Waitable Timers – Call CreateWaitableTimers() to make a waitable timer, which you can then pass to a function like WSAEventSelect() along with your sockets: if none of the sockets is signalled before the timer goes off, the blocking function will return anyway.
, -. , Winsock . , , , , Winsocks, .