]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/unix/socket.cpp
Add a dynamic receiver class for more flexible packet handling
[libs/net.git] / source / net / unix / socket.cpp
index b8cc580f0040f7f16c1bf8adbc4668dce5a2c6ec..2c1e2ad8d355ac9e0fe9a31b5292f0709535c2f8 100644 (file)
@@ -1,12 +1,12 @@
+#include "platform_api.h"
+#include "socket.h"
 #include <cerrno>
 #include <unistd.h>
 #include <fcntl.h>
-#include "platform_api.h"
 #include <msp/core/systemerror.h>
 #include <msp/io/handle_private.h>
 #include <msp/time/rawtime_private.h>
 #include "sockaddr_private.h"
-#include "socket.h"
 #include "socket_private.h"
 
 using namespace std;
@@ -64,7 +64,7 @@ size_t check_sys_error(make_signed<size_t>::type ret, const char *func)
 {
        if(ret<0)
        {
-               if(errno==EAGAIN)
+               if(errno==EAGAIN || errno==EWOULDBLOCK)
                        return 0;
                else
                        throw system_error(func);