aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32.c
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2013-08-16 00:14:02 +0300
committerLee Salzman <[email protected]>2013-08-16 00:14:02 +0300
commite123218df3e638b138a2024b24a2607c9583a797 (patch)
tree6799ee643a1b0011cddde0a90a947601ce4fe58d /win32.c
parent73ef8d8a96176d276e08cd32c360bde0bab41d73 (diff)
downloadenet-e123218df3e638b138a2024b24a2607c9583a797.tar.gz
enet-e123218df3e638b138a2024b24a2607c9583a797.zip
added enet_socket_get_option() and ENET_SOCKOPT_ERROR
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/win32.c b/win32.c
index 99b81aa..1950da9 100644
--- a/win32.c
+++ b/win32.c
@@ -202,6 +202,19 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
}
int
+enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
+{
+ int result = SOCKET_ERROR;
+ switch (option)
+ {
+ case ENET_SOCKOPT_ERROR:
+ result = setsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, sizeof (int));
+ break;
+ }
+ return result == SOCKET_ERROR ? -1 : 0;
+}
+
+int
enet_socket_connect (ENetSocket socket, const ENetAddress * address)
{
struct sockaddr_in sin;