From e7404fea378cb13f880df3cf1ea6e75adc1af1d6 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 15 May 2020 22:28:01 -0400 Subject: [PATCH] Gah --- .../Session/SessionControllerFactory.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs index fc1cd8fbdd..be732f40f8 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs @@ -112,6 +112,24 @@ namespace Tgstation.Server.Host.Components.Session }; } + /// + /// Check if a given can be bound to. + /// + /// The port number to test. + static void PortBindTest(ushort port) + { + using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + + try + { + socket.Bind(new IPEndPoint(IPAddress.Loopback, port)); + } + catch (Exception ex) + { + throw new JobException(ErrorCode.DreamDaemonPortInUse, ex); + } + } + /// /// Construct a /// @@ -425,23 +443,5 @@ namespace Tgstation.Server.Host.Components.Session if(otherUserName.Equals(ourUserName, StringComparison.Ordinal)) throw new JobException(ErrorCode.DeploymentPagerRunning); } - - /// - /// Check if a given can be bound to. - /// - /// The port number to test. - static void PortBindTest(ushort port) - { - using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - - try - { - socket.Bind(new IPEndPoint(IPAddress.Loopback, port)); - } - catch (Exception ex) - { - throw new JobException(ErrorCode.DreamDaemonPortInUse, ex); - } - } } }