Test whether created sockets are select()able

This commit is contained in:
Pieter Wuille
2015-07-09 18:23:27 -04:00
parent 943b322d5d
commit d422f9b1fd
3 changed files with 29 additions and 0 deletions

View File

@@ -266,6 +266,9 @@ bool static InterruptibleRecv(char* data, size_t len, int timeout, SOCKET& hSock
} else { // Other error or blocking
int nErr = WSAGetLastError();
if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) {
if (!IsSelectableSocket(hSocket)) {
return false;
}
struct timeval tval = MillisToTimeval(std::min(endTime - curTime, maxWait));
fd_set fdset;
FD_ZERO(&fdset);