diff options
author | Lee Salzman <[email protected]> | 2013-08-16 00:14:02 +0300 |
---|---|---|
committer | Lee Salzman <[email protected]> | 2013-08-16 00:14:02 +0300 |
commit | e123218df3e638b138a2024b24a2607c9583a797 (patch) | |
tree | 6799ee643a1b0011cddde0a90a947601ce4fe58d /win32.c | |
parent | 73ef8d8a96176d276e08cd32c360bde0bab41d73 (diff) | |
download | enet-e123218df3e638b138a2024b24a2607c9583a797.tar.gz enet-e123218df3e638b138a2024b24a2607c9583a797.zip |
added enet_socket_get_option() and ENET_SOCKOPT_ERROR
Diffstat (limited to 'win32.c')
-rw-r--r-- | win32.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |