Exemple #1
0
        async void AcceptConnection()
        {
            while (isRunning)
            {
                // Accept a new connection every 200ms.
                Thread.Sleep(200);

                if (listener.Pending())
                {
                    var clientSocket = await listener.AcceptSocketAsync();

                    if (clientSocket != null)
                    {
                        var worker = new RealmSession(clientSocket);

                        await Task.Factory.StartNew(worker.Accept);
                    }
                }
            }
        }
Exemple #2
0
        async void AcceptConnection()
        {
            while (isRunning)
            {
                // Accept a new connection every 200ms.
                Thread.Sleep(200);

                if (listener.Pending())
                {
                    var clientSocket = await listener.AcceptSocketAsync();

                    if (clientSocket != null)
                    {
                        var worker = new RealmSession(clientSocket);

                        await Task.Factory.StartNew(worker.Accept);
                    }
                }
            }
        }