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

@@ -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