From ce050d69396dfca8bfb03081fa1315027741c797 Mon Sep 17 00:00:00 2001 From: wmpadmin Date: Tue, 3 Apr 2018 22:58:38 +0200 Subject: [PATCH 1/2] cleaning --- server/Server/PoolConnection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/Server/PoolConnection.cs b/server/Server/PoolConnection.cs index 604b212..a65a5a0 100644 --- a/server/Server/PoolConnection.cs +++ b/server/Server/PoolConnection.cs @@ -287,7 +287,7 @@ namespace Server { connection.TcpClient.Client.Close (); connection.ReceiveBuffer = null; - try { PoolConnection dummy; Connections.TryRemove (connection.Credentials, out dummy); } catch { } + Connections.TryRemove(connection.Credentials); Console.WriteLine ("{0}: closed a pool connection.", client.WebSocket.ConnectionInfo.Id); @@ -314,7 +314,7 @@ namespace Server { try { connection.TcpClient.Close (); } catch { } try { connection.TcpClient.Client.Close (); } catch { } - try { connection.ReceiveBuffer = null; } catch { } + connection.ReceiveBuffer = null; connection.LastInteraction = DateTime.Now; From 20965ead4eba51517e421736a22683538bfb9acf Mon Sep 17 00:00:00 2001 From: wmpadmin Date: Wed, 4 Apr 2018 08:22:29 +0200 Subject: [PATCH 2/2] cleaning --- server/Server/PoolConnection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/Server/PoolConnection.cs b/server/Server/PoolConnection.cs index a65a5a0..375ac74 100644 --- a/server/Server/PoolConnection.cs +++ b/server/Server/PoolConnection.cs @@ -283,9 +283,9 @@ namespace Server { networkStream.EndRead (null); } catch { } - connection.TcpClient.Close (); - connection.TcpClient.Client.Close (); - connection.ReceiveBuffer = null; + try { connection.TcpClient.Close ();} catch { } + try { connection.TcpClient.Client.Close ();} catch { } + try { connection.ReceiveBuffer = null;} catch { } Connections.TryRemove(connection.Credentials);