diff options
-rw-r--r-- | ev_win32.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -48,6 +48,16 @@ /* for the crt to do something about it */ volatile double SIGFPE_REQ = 0.0f; +static SOCKET +ev_tcp_socket (void) +{ +#if EV_USE_WSASOCKET + return WSASocket (AF_INET, SOCK_STREAM, 0, 0, 0, 0); +#else + return socket (AF_INET, SOCK_STREAM, 0); +#endif +} + /* oh, the humanity! */ static int ev_pipe (int filedes [2]) @@ -59,7 +69,7 @@ ev_pipe (int filedes [2]) SOCKET listener; SOCKET sock [2] = { -1, -1 }; - if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) + if ((listener = ev_tcp_socket ()) == INVALID_SOCKET) return -1; addr.sin_family = AF_INET; @@ -75,7 +85,7 @@ ev_pipe (int filedes [2]) if (listen (listener, 1)) goto fail; - if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) + if ((sock [0] = ev_tcp_socket ()) == INVALID_SOCKET) goto fail; if (connect (sock [0], (struct sockaddr *)&addr, addr_size)) |