added enet_socket_get_option() and ENET_SOCKOPT_ERROR

This commit is contained in:
Lee Salzman
2013-08-16 00:14:02 +03:00
parent 73ef8d8a96
commit e123218df3
4 changed files with 32 additions and 1 deletions
+13
View File
@@ -201,6 +201,19 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
return result == SOCKET_ERROR ? -1 : 0;
}
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)
{