Esempio n. 1
0
 private void HandleDisconnect()
 {
     client?.Close();
     server?.Close();
     client = null;
     server = null;
     Disconnected?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 2
0
        public void Disconnect()
        {
            try
            {
                SendDisconnect();
            }
            catch
            {
                // ignore
            }

            client?.Close();
            server?.Close();
            client = null;
            server = null;
            Disconnected?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 3
0
 public void Stop()
 {
     _logger.Info("Shutting down...");
     _remoteServer.Close();
     _natServer.Stop();
     _natServer2.Stop();
     _server.Stop();
     _logger.Dispose();
     _packetLogger.Dispose();
 }
Esempio n. 4
0
        private void HandleDisconnect()
        {
            lock (registeredResponseHandlers)
            {
                registeredResponseHandlers.Clear();
            }
            lock (registeredHeartbeatHandlers)
            {
                registeredHeartbeatHandlers.Clear();
            }

            server?.Close();
            client?.Close();
            client = null;
            server = null;
            Disconnected?.Invoke(this, EventArgs.Empty);
            serverState = ServerState.Offline;
        }