Set SO_REUSEADDR on network sockets.

This commit is contained in:
Egor Vorontsov
2025-12-16 06:24:30 +03:00
parent c509698b54
commit 56b75aaffc
2 changed files with 10 additions and 0 deletions

View File

@@ -288,6 +288,11 @@ void NetworkServer::StartServer()
return;
}
/*---------------------------------------------------------*\
| Set socket options - reuse addr |
\*---------------------------------------------------------*/
setsockopt(server_sock[socket_count], SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
/*---------------------------------------------------------*\
| Bind the server socket |
\*---------------------------------------------------------*/