From d900eaf71a688bb7198f14b45f131e99c0328b0f Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 11 Jul 2020 09:48:03 -0400 Subject: [PATCH] Only throw error code 78 on correct socket error --- .../Components/Session/SessionControllerFactory.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs index 3b7a617e41..e1e77a2098 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs @@ -124,8 +124,10 @@ namespace Tgstation.Server.Host.Components.Session { socket.Bind(new IPEndPoint(IPAddress.Any, port)); } - catch (Exception ex) + catch (SocketException ex) { + if(ex.SocketErrorCode != SocketError.AddressAlreadyInUse) + throw; throw new JobException(ErrorCode.DreamDaemonPortInUse, ex); } }