Ejemplo n.º 1
0
        public void AcceptCallBack(IAsyncResult result)
        {
            AuthClient _newClient = new AuthClient(socket.EndAccept(result), this)
            {
                Ticket = Tools.RandomString(32, false)
            };

            Out.Debug($"New socket [{_newClient.socket.RemoteEndPoint}]");
            _newClient.Initialize();
            Clients.Add(_newClient.socket, _newClient);

            socket.BeginAccept(AcceptCallBack, null);
        }
Ejemplo n.º 2
0
        public void AcceptCallBack(IAsyncResult result)
        {
            try
            {
                AuthClient _newClient = new AuthClient(socket.EndAccept(result), this)
                {
                    Ticket = Tools.RandomString(32, false)
                };
                Out.Debug($"New socket [{_newClient.socket.RemoteEndPoint}]");
                //_newClient.Initialize();
                Clients.Add(_newClient.socket, _newClient);

                socket.BeginAccept(AcceptCallBack, null);
            }catch (Exception e)
            {
                if (Clients != null)
                {
                    Out.Error(e.Message);
                }
            }
        }