mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-05 18:23:03 +01:00
Test whether created sockets are select()able
This commit is contained in:
@@ -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