1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Fix #5984: Allow socket binding to same port after crash

This commit is contained in:
zsilencer
2017-07-24 11:24:19 -06:00
committed by Michael Steenbeek
parent fabf7f9fb5
commit 424f2fcef5
2 changed files with 7 additions and 0 deletions

View File

@@ -147,6 +147,12 @@ public:
log_error("IPV6_V6ONLY failed. %d", LAST_SOCKET_ERROR());
}
value = 1;
if (setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&value, sizeof(value)) != 0)
{
log_error("SO_REUSEADDR failed. %d", LAST_SOCKET_ERROR());
}
try
{
// Bind to address:port and listen