diff --git a/server/Server/PoolConnection.cs b/server/Server/PoolConnection.cs index 604b212..375ac74 100644 --- a/server/Server/PoolConnection.cs +++ b/server/Server/PoolConnection.cs @@ -283,11 +283,11 @@ 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 { } - 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;