Skip to content

Commit

Permalink
fix: windows use of REUSEADDR
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Nov 27, 2024
1 parent 7d2811d commit 0ac23ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions toxcore/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,11 @@ bool set_socket_nosigpipe(const Network *ns, Socket sock)
bool set_socket_reuseaddr(const Network *ns, Socket sock)
{
int set = 1;
#if defined(OS_WIN32)
return net_setsockopt(ns, sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, &set, sizeof(set)) == 0;
#else
return net_setsockopt(ns, sock, SOL_SOCKET, SO_REUSEADDR, &set, sizeof(set)) == 0;
#endif /* OS_WIN32 */
}

bool set_socket_dualstack(const Network *ns, Socket sock)
Expand Down

0 comments on commit 0ac23ce

Please sign in to comment.