Unblock a Blocked Winsock accept() Call
The only way to unblock a blocking accept()
is to close the listening socket from another thread. Otherwise, you need put the listening socket into non-blocking mode and use select()
(which does support a timeout) to detect when accept()
can be called without blocking.