Ejemplo n.º 1
0
 public void DisconnectClient()
 {
     socket.Close();
     stream.Dispose();
     socket.Dispose();
     Disconnection?.Invoke();
 }
Ejemplo n.º 2
0
        private void _handleDisconnection(IPEndPoint endpoint)
        {
            _connections[endpoint].StopSendLoop();
            _connections.Remove(endpoint);

            Disconnection?.Invoke(endpoint);
        }
        private void CloseClientSocket(NetConnection connection)
        {
            try
            {
                connection.Socket.Close(CloseTimeout);
            }
            catch (Exception) // throws if client process has already closed
            {
            }

            Disconnection?.Invoke(this, connection);
        }
Ejemplo n.º 4
0
        public void CloseConnection(IPEndPoint endpoint)
        {
            if (!_connections.ContainsKey(endpoint))
            {
                throw new InvalidOperationException("Client is not connected");
            }

            Send(new[] { (byte)MessageIdentifiers.DisconnectionNotification }, endpoint);

            _connections[endpoint].StopSendLoop();
            _connections.Remove(endpoint);

            Disconnection?.Invoke(endpoint);
        }
Ejemplo n.º 5
0
 internal void RaiseDisconnection(string reason)
 {
     Disconnection?.Invoke(this, reason);
 }
Ejemplo n.º 6
0
 // Token: 0x0600001B RID: 27 RVA: 0x000024CE File Offset: 0x000006CE
 internal void CloseCallback(ServerClient client)
 {
     clients.Remove(client);
     Disconnection?.Invoke(client);
 }
Ejemplo n.º 7
0
 // Token: 0x0600000E RID: 14 RVA: 0x0000228E File Offset: 0x0000048E
 private void CloseCallback(object sender, CloseEventArgs e)
 {
     Disconnection?.Invoke();
 }