diff options
| author | Pieter Wuille <[email protected]> | 2015-07-09 18:23:27 -0400 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2015-07-10 12:05:09 -0400 |
| commit | d422f9b1fdb42a51aadaa1bbc157542dca2feb17 (patch) | |
| tree | baca8c375b2e39e5fac9669adfe117c25bec682e /src/compat.h | |
| parent | Merge pull request #5486 (diff) | |
| download | discoin-d422f9b1fdb42a51aadaa1bbc157542dca2feb17.tar.xz discoin-d422f9b1fdb42a51aadaa1bbc157542dca2feb17.zip | |
Test whether created sockets are select()able
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 7a5438a11..f88b6ce36 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 |