util: Expose IOErrorIsPermanent in sock header

Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
This commit is contained in:
Fabian Jahr
2026-05-20 16:39:06 +02:00
parent 5d562430de
commit 376e7ef07c
2 changed files with 5 additions and 5 deletions

View File

@@ -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)

View File

@@ -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.
*/