Пример #1
0
        async void AcceptConnection()
        {
            while (listenSocket)
            {
                Thread.Sleep(1);

                if (listener.Pending())
                {
                    Client client = new Client()
                    {
                        clientSocket = await listener.AcceptSocketAsync(),
                        clientType   = listenerType
                    };

                    client.OnConnect();
                }
            }
        }