diff options
-rw-r--r-- | include/socketengine.h | 13 | ||||
-rw-r--r-- | src/socketengine.cpp | 14 |
2 files changed, 13 insertions, 14 deletions
diff --git a/include/socketengine.h b/include/socketengine.h index 293d27e43..2fc3cdbfd 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -496,6 +496,19 @@ public: static bool IgnoreError(); }; +inline bool SocketEngine::IgnoreError() +{ + if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) + return true; + +#ifdef _WIN32 + if (WSAGetLastError() == WSAEWOULDBLOCK) + return true; +#endif + + return false; +} + SocketEngine* CreateSocketEngine(); #endif diff --git a/src/socketengine.cpp b/src/socketengine.cpp index cbdfb5651..6c99edc95 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -255,17 +255,3 @@ void SocketEngine::GetStats(float &kbitpersec_in, float &kbitpersec_out, float & kbitpersec_in = in_kbit / 1024; kbitpersec_out = out_kbit / 1024; } - -bool SocketEngine::IgnoreError() -{ - if (errno == EAGAIN) - return true; - -#ifdef _WIN32 - if (WSAGetLastError() == WSAEWOULDBLOCK) - return true; -#endif - - return false; -} - |