public void Close() { lock (SendLock) { if (listener != null) { try { listener.Shutdown(SocketShutdown.Both); } finally { listener.Close(); listener = null; } } StopThread(); SocketList.Clear(); Packets.Clear(); ToPeer.Clear(); SocketToKey.Clear(); clientcheck.Clear(); OnListenClient.Clear(); GetMessage = null; RSAkey = new EncryptAndCompress.RSAKeyPair(); } }
public void Close() { if (listener != null) { try { listener.Shutdown(SocketShutdown.Both); } catch (Exception) { } finally { listener.Close(); listener = null; } } SocketList.Clear(); Packets.Clear(); ToPeer.Clear(); SocketToEndPoint.Clear(); SocketToKey.Clear(); GetMessage = null; RSAkey = new EncryptAndCompress.RSAKeyPair(); }