mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-27 22:34:18 +02:00
util: Expose IOErrorIsPermanent in sock header
Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
This commit is contained in:
@@ -26,11 +26,6 @@
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
static inline bool IOErrorIsPermanent(int err)
|
||||
{
|
||||
return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
|
||||
}
|
||||
|
||||
Sock::Sock(SOCKET s) : m_socket(s) {}
|
||||
|
||||
Sock::Sock(Sock&& other)
|
||||
|
||||
@@ -23,6 +23,11 @@ class CThreadInterrupt;
|
||||
*/
|
||||
static constexpr auto MAX_WAIT_FOR_IO = 1s;
|
||||
|
||||
inline bool IOErrorIsPermanent(int err)
|
||||
{
|
||||
return err != WSAEAGAIN && err != WSAEINTR && err != WSAEWOULDBLOCK && err != WSAEINPROGRESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* RAII helper class that manages a socket and closes it automatically when it goes out of scope.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user