Ejemplo n.º 1
0
        public void Close()
        {
            lock (_closeConnLock)
            {
                if (_closed)
                {
                    return;
                }

                _closed = true;
            }

            OnClosed?.Invoke(this, new SSRelayEventArgs(_server));

            try
            {
                _connection.Shutdown(SocketShutdown.Both);
                _connection.Close();

                encryptor?.Dispose();
                decryptor?.Dispose();
            }
            catch (Exception e)
            {
                this.Log().Error(e, "");
            }
        }