示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }