Пример #1
0
        public void Disconnect()
        {
            if (client != null)
            {
                try
                {
                    client.Close();
                }
                catch (Exception) { }

                client = null;
                handler.DisconnectCallback();
            }
        }
Пример #2
0
        public void Disconnect()
        {
            if (_socket != null)
            {
                try
                {
                    _socket.Shutdown(SocketShutdown.Both);
                    _socket.Close();
                }
                catch (Exception) { }

                _socket = null;
                handler.DisconnectCallback();
            }
        }