Example #1
0
        private void sockServer_OnClientDisconnected(object sender, ClientDisconnectedEventArgs args)
        {
            if (dctClientes.ContainsKey(args.ClientNumber))
            {
                logger.Info("Cliente [" + args.ClientNumber + "] desconectou");

                AnaliseGraficaHandlerState state = dctClientes[args.ClientNumber];

                state.HandlerAnaliseGrafica.Stop();

                dctClientes.Remove(args.ClientNumber);
            }
        }
Example #2
0
        private void sockServer_OnClientConnected(object sender, ClientConnectedEventArgs args)
        {
            lock (dctClientes)
            {
                logger.Info("Cliente [" + args.ClientNumber + "] [" + args.ClientSocket.RemoteEndPoint.ToString() + "]");

                AnaliseGraficaHandlerState state = new AnaliseGraficaHandlerState();

                state.ClientNumber          = args.ClientNumber;
                state.ClientSocket          = args.ClientSocket;
                state.HandlerAnaliseGrafica = new AnaliseGraficaClientHandler(args.ClientNumber, args.ClientSocket);
                state.HandlerAnaliseGrafica.Start();
                state.HandlerAnaliseGrafica.TratarConexaoANG(args.ClientSocket.RemoteEndPoint.ToString());

                dctClientes.Add(args.ClientNumber, state);
            }
        }