private void sockServer_OnClientDisconnected(object sender, ClientDisconnectedEventArgs args) { logger.Info("Cliente [" + args.ClientNumber + "] desconectou"); if (dctClientes.ContainsKey(args.ClientNumber)) { ClientHandlerState state = dctClientes[args.ClientNumber]; state.ClientHandler.Stop(); dctClientes.Remove(args.ClientNumber); } }
private void NotificaClienteDesconectado(object objeto) { ClientSocketPacket socketData = (ClientSocketPacket)objeto; ClientDisconnectedEventArgs args = new ClientDisconnectedEventArgs(); args.ClientNumber = socketData.ClientNumber; args.ClientSocket = socketData.CurrentSocket; if (OnClientDisconnected != null) { OnClientDisconnected(this, args); } }