Index: common/Common.h
===================================================================
--- common/Common.h	(revision 3b1efcc97deda61383fe1470d63eb56b0e172045)
+++ common/Common.h	(revision cdb4bec03046cb6823e52433c95f41a2426aaa2f)
@@ -4,8 +4,13 @@
 void set_nonblock(int sock)
 {
-    int flags;
-    flags = fcntl(sock, F_GETFL,0);
-    assert(flags != -1);
-    fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+   #ifdef WIN32
+      unsigned long mode = 1;
+      ioctlsocket(sock, FIONBIO, &mode);
+   #else
+      int flags;
+      flags = fcntl(sock, F_GETFL,0);
+      assert(flags != -1);
+      fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+   #endif
 }
 
