summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/socketengine.h13
1 files changed, 13 insertions, 0 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