diff options
Diffstat (limited to 'unix.c')
-rw-r--r-- | unix.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -254,6 +254,7 @@ int enet_socket_connect (ENetSocket socket, const ENetAddress * address) { struct sockaddr_in sin; + int result; memset (& sin, 0, sizeof (struct sockaddr_in)); @@ -261,7 +262,11 @@ enet_socket_connect (ENetSocket socket, const ENetAddress * address) sin.sin_port = ENET_HOST_TO_NET_16 (address -> port); sin.sin_addr.s_addr = address -> host; - return connect (socket, (struct sockaddr *) & sin, sizeof (struct sockaddr_in)); + result = connect (socket, (struct sockaddr *) & sin, sizeof (struct sockaddr_in)); + if (result == -1 && errno == EINPROGRESS) + return 0; + + return result; } ENetSocket @@ -287,6 +292,12 @@ enet_socket_accept (ENetSocket socket, ENetAddress * address) return result; } +int +enet_socket_shutdown (ENetSocket socket, ENetSocketShutdown how) +{ + return shutdown (socket, (int) how); +} + void enet_socket_destroy (ENetSocket socket) { |