aboutsummaryrefslogtreecommitdiffhomepage
path: root/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/unix.c b/unix.c
index 7bbe77a..d425b4b 100644
--- a/unix.c
+++ b/unix.c
@@ -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)
{