Ejemplo n.º 1
0
        private async Task AcceptLoop(EventPipeServerTransport transport, CancellationToken cancellationToken)
        {
            transport.Listen();

            while (!cancellationToken.IsCancellationRequested)
            {
                var pipe = await transport.AcceptAsync(cancellationToken);

                var server = new EventPipeServer(pipe);
                _ = server.RunAsync(cancellationToken);
            }
        }
Ejemplo n.º 2
0
        private async Task AcceptLoop(TcpListener listener, CancellationToken cancellationToken)
        {
            while (!cancellationToken.IsCancellationRequested)
            {
                var client = await listener.AcceptTcpClientAsync();

                Trace("Accepted socket");

                var pipe   = client.GetStream().CreatePipe();
                var server = new EventPipeServer(pipe);
                _ = server.RunAsync();
            }
        }