public void Disconnect() { if (client != null) { try { client.Close(); } catch (Exception) { } client = null; handler.DisconnectCallback(); } }
public void Disconnect() { if (_socket != null) { try { _socket.Shutdown(SocketShutdown.Both); _socket.Close(); } catch (Exception) { } _socket = null; handler.DisconnectCallback(); } }