summaryrefslogtreecommitdiff
path: root/include/socketengine.h
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-24 19:54:58 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-24 19:54:58 +0200
commit2bb64c5dcfb66e9bf7f6114de6501fd5dcd97138 (patch)
treeff4b77e32e5df3800dd8c27434ba375978e27ae8 /include/socketengine.h
parent40398162c326eab06d1ce6e9397c25b0a32fa368 (diff)
Move SocketEngine::IgnoreError() code into socketengine.h and add test for EWOULDBLOCK
Diffstat (limited to 'include/socketengine.h')
-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