Esempio n. 1
0
        private Client GetClient(TcpClient clientSocket)
        {
            StreamReader sr     = new StreamReader(clientSocket.GetStream());
            string       name   = String.Empty;
            Client       result = null;

            while (true)
            {
                if (clientSocket.GetStream().DataAvailable)
                {
                    name = AuthManager.ConnectionProcessing(clientSocket, sr.ReadLine(), connList);
                    break;
                }
                Thread.Sleep(20);
            }

            if (name != null)
            {
                result = new Client(name, clientSocket);
            }

            return(result);
        }