mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 13:36:50 +01:00
Fix socket lingering
This commit is contained in:
@@ -217,7 +217,6 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
if (!launchParameters.Port.HasValue)
|
||||
throw new InvalidOperationException("Given port is null!");
|
||||
|
||||
PortBindTest(launchParameters.Port.Value);
|
||||
switch (dmbProvider.CompileJob.MinimumSecurityLevel)
|
||||
{
|
||||
case DreamDaemonSecurity.Ultrasafe:
|
||||
@@ -255,8 +254,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
if (dmbProvider.EngineVersion.Engine.Value == EngineType.Byond)
|
||||
await CheckPagerIsNotRunning();
|
||||
|
||||
if (platformIdentifier.IsWindows)
|
||||
await asyncDelayer.Delay(TimeSpan.FromMilliseconds(500), cancellationToken); // Server can trip after we bind tested the port
|
||||
PortBindTest(launchParameters.Port.Value);
|
||||
|
||||
string outputFilePath = null;
|
||||
var preserveLogFile = true;
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace Tgstation.Server.Host.Extensions
|
||||
ProtocolType.Tcp);
|
||||
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, true);
|
||||
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false);
|
||||
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, true);
|
||||
if (includeIPv6)
|
||||
socket.DualMode = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user