From d422f9b1fdb42a51aadaa1bbc157542dca2feb17 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 9 Jul 2015 18:23:27 -0400 Subject: Test whether created sockets are select()able --- src/compat.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/compat.h') 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 -- cgit v1.2.3