diff --git a/Server/Core/Server.cs b/Server/Core/Server.cs index d7a98ef6..bb3822cc 100644 --- a/Server/Core/Server.cs +++ b/Server/Core/Server.cs @@ -94,6 +94,16 @@ public void Listen(ushort port) _item = new SocketAsyncEventArgs(); _item.Completed += Process; + if (_handle != null) + { + try + { + _handle.Close(); + } + catch + { } + } + _handle = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _handle.Bind(new IPEndPoint(IPAddress.Any, port));