(netplay.c) Use socket_bind
This commit is contained in:
parent
004d9a613c
commit
f4762f6f33
|
@ -136,7 +136,7 @@ static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
|
||||||
if (!socket_nonblock(handle->net_fd))
|
if (!socket_nonblock(handle->net_fd))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!socket_bind(handle->net_fd, res))
|
if (!socket_bind(handle->net_fd, (void*)res))
|
||||||
{
|
{
|
||||||
RARCH_ERR("Failed to bind socket.\n");
|
RARCH_ERR("Failed to bind socket.\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -667,10 +667,7 @@ static int init_tcp_connection(const struct addrinfo *res,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int yes = 1;
|
if ( !socket_bind(fd, (void*)res) ||
|
||||||
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&yes, sizeof(int));
|
|
||||||
|
|
||||||
if (bind(fd, res->ai_addr, res->ai_addrlen) < 0 ||
|
|
||||||
listen(fd, spectate ? MAX_SPECTATORS : 1) < 0)
|
listen(fd, spectate ? MAX_SPECTATORS : 1) < 0)
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
|
|
Loading…
Reference in New Issue