diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-07-20 16:54:18 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-07-20 16:54:28 +0200 |
commit | 1a2de3237fc06a97dd83ab12759c57d83db370ef (patch) | |
tree | 41e95768db9f2aa7314fa3f898239c5c1d3e5e74 /src/compat.h | |
parent | dc51608c9c279a3eb33e9a071ded27f613282ac7 (diff) | |
parent | d422f9b1fdb42a51aadaa1bbc157542dca2feb17 (diff) |
Merge pull request #6412
d422f9b Test whether created sockets are select()able (Pieter Wuille)
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compat.h b/src/compat.h index 7a5438a11e..f88b6ce36e 100644 --- a/src/compat.h +++ b/src/compat.h @@ -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 |