public void DisconnectClient() { socket.Close(); stream.Dispose(); socket.Dispose(); Disconnection?.Invoke(); }
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); }
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); }
internal void RaiseDisconnection(string reason) { Disconnection?.Invoke(this, reason); }
// Token: 0x0600001B RID: 27 RVA: 0x000024CE File Offset: 0x000006CE internal void CloseCallback(ServerClient client) { clients.Remove(client); Disconnection?.Invoke(client); }
// Token: 0x0600000E RID: 14 RVA: 0x0000228E File Offset: 0x0000048E private void CloseCallback(object sender, CloseEventArgs e) { Disconnection?.Invoke(); }