diff --git a/command.c b/command.c index 083ac124b0..0994d77652 100644 --- a/command.c +++ b/command.c @@ -136,7 +136,7 @@ static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port) if (!socket_nonblock(handle->net_fd)) goto error; - if (!socket_bind(handle->net_fd, res)) + if (!socket_bind(handle->net_fd, (void*)res)) { RARCH_ERR("Failed to bind socket.\n"); goto error; diff --git a/netplay/netplay.c b/netplay/netplay.c index 7cbdc835c2..cbf9113929 100644 --- a/netplay/netplay.c +++ b/netplay/netplay.c @@ -667,10 +667,7 @@ static int init_tcp_connection(const struct addrinfo *res, } else { - int yes = 1; - setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&yes, sizeof(int)); - - if (bind(fd, res->ai_addr, res->ai_addrlen) < 0 || + if ( !socket_bind(fd, (void*)res) || listen(fd, spectate ? MAX_SPECTATORS : 1) < 0) { ret = false;