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

@ -13,6 +13,7 @@
- Fix: [#5920] Placing guest spawn doesn't do anything every 3rd click
- Fix: [#5939] Crash when importing 'Six Flags Santa Fe'.
- Fix: [#5977] Custom music files not showing up in music list
- Fix: [#5984] Allow socket binding to same port after crash
- Improved: [#4301] Leading and trailing whitespace in player name is now removed.
- Improved: [#5859] OpenGL rendering performance
- Improved: [#5863] Switching drawing engines no longer requires the application to restart.

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