diff options
author | root <root> | 2012-02-19 02:03:11 +0000 |
---|---|---|
committer | root <root> | 2012-02-19 02:03:11 +0000 |
commit | 4cac0415119528257f8e002346a7c5a8a0893bbf (patch) | |
tree | b0e76fc411c2c93431a32444893b31f77859a523 | |
parent | da701b874dce05b1fd0b3e9144b10891b7570016 (diff) |
*** empty log message ***
-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)) |