diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-07-09 18:23:27 -0400 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2015-07-10 12:05:09 -0400 |
commit | d422f9b1fdb42a51aadaa1bbc157542dca2feb17 (patch) | |
tree | baca8c375b2e39e5fac9669adfe117c25bec682e /src/netbase.cpp | |
parent | 943b322d5d292707e193f3a9d8e971881540be23 (diff) |
Test whether created sockets are select()able
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index c9fc7d67f7..b7e2e57917 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -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); |