Test whether created sockets are select()able
Conflicts: src/net.cpp Rebased-From: d422f9b1fdb42a51aadaa1bbc157542dca2feb17
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
ea5b5ddd7c
commit
0095b9a1ff
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user