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 /unix.c | |
parent | 73ef8d8a96176d276e08cd32c360bde0bab41d73 (diff) | |
download | enet-e123218df3e638b138a2024b24a2607c9583a797.tar.gz enet-e123218df3e638b138a2024b24a2607c9583a797.zip |
added enet_socket_get_option() and ENET_SOCKOPT_ERROR
Diffstat (limited to 'unix.c')
-rw-r--r-- | unix.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -272,6 +272,19 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value) } int +enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value) +{ + int result = -1; + switch (option) + { + case ENET_SOCKOPT_ERROR: + result = setsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, sizeof (int)); + break; + } + return result == -1 ? -1 : 0; +} + +int enet_socket_connect (ENetSocket socket, const ENetAddress * address) { struct sockaddr_in sin; |