Test whether created sockets are select()able

Conflicts:
	src/net.cpp

Rebased-From: d422f9b1fdb42a51aadaa1bbc157542dca2feb17
This commit is contained in:
Pieter Wuille
2015-07-09 18:23:27 -04:00
committed by Wladimir J. van der Laan
parent ea5b5ddd7c
commit 0095b9a1ff
3 changed files with 30 additions and 0 deletions

View File

@@ -92,4 +92,12 @@ typedef u_int SOCKET;
size_t strnlen( const char *start, size_t max_len);
#endif // HAVE_DECL_STRNLEN
bool static inline IsSelectableSocket(SOCKET s) {
#ifdef WIN32
return true;
#else
return (s >= 0 && s < FD_SETSIZE);
#endif
}
#endif // BITCOIN_COMPAT_H