Exemplo n.º 1
0
        private async static Task <EpoxyTransport> SetupAsync()
        {
            var transport = new EpoxyTransportBuilder()
                            .SetLogSink(new ConsoleLogger())
                            .SetMetricsSink(new ConsoleMetricsSink())
                            .Construct();

            var pingEndpoint        = new IPEndPoint(IPAddress.Loopback, pingPort);
            var reversePingEndpoint = new IPEndPoint(IPAddress.Loopback, reversePingPort);

            var           pingPongService  = new PingPongService();
            EpoxyListener pingPongListener = transport.MakeListener(pingEndpoint);

            pingPongListener.AddService(pingPongService);

            var           reversePingPongService  = new ReversePingPongService();
            EpoxyListener reversePingPongListener = transport.MakeListener(reversePingEndpoint);

            reversePingPongListener.AddService(reversePingPongService);

            await Task.WhenAll(
                pingPongListener.StartAsync(),
                reversePingPongListener.StartAsync());

            s_pingConnection = await transport.ConnectToAsync(pingPongListener.ListenEndpoint, CancellationToken.None);

            s_reverseConnection = await transport.ConnectToAsync(reversePingPongListener.ListenEndpoint, CancellationToken.None);

            return(transport);
        }
Exemplo n.º 2
0
        private async static Task <EpoxyTransport> SetupAsync()
        {
            var transport = new EpoxyTransportBuilder()
                            .SetLogSink(new ConsoleLogger())
                            .Construct();

            var           pingPongService  = new PingPongService();
            EpoxyListener pingPongListener = transport.MakeListener(PingEndpoint);

            pingPongListener.AddService(pingPongService);

            var           reversePingPongService  = new ReversePingPongService();
            EpoxyListener reversePingPongListener = transport.MakeListener(ReversePingEndpoint);

            reversePingPongListener.AddService(reversePingPongService);

            await Task.WhenAll(
                pingPongListener.StartAsync(),
                reversePingPongListener.StartAsync());

            pingConnection = await transport.ConnectToAsync(PingUri);

            reverseConnection = await transport.ConnectToAsync(ReversePingUri);

            return(transport);
        }
Exemplo n.º 3
0
        private async static Task<EpoxyTransport> SetupAsync()
        {
            var transport = new EpoxyTransportBuilder()
                .SetLogSink(new ConsoleLogger())
                .SetMetricsSink(new ConsoleMetricsSink())
                .Construct();

            var pingEndpoint = new IPEndPoint(IPAddress.Loopback, pingPort);
            var reversePingEndpoint = new IPEndPoint(IPAddress.Loopback, reversePingPort);

            var pingPongService = new PingPongService();
            EpoxyListener pingPongListener = transport.MakeListener(pingEndpoint);
            pingPongListener.AddService(pingPongService);

            var reversePingPongService = new ReversePingPongService();
            EpoxyListener reversePingPongListener = transport.MakeListener(reversePingEndpoint);
            reversePingPongListener.AddService(reversePingPongService);

            await Task.WhenAll(
                pingPongListener.StartAsync(),
                reversePingPongListener.StartAsync());

            s_pingConnection = await transport.ConnectToAsync(pingPongListener.ListenEndpoint, CancellationToken.None);
            s_reverseConnection = await transport.ConnectToAsync(reversePingPongListener.ListenEndpoint, CancellationToken.None);

            return transport;
        }
Exemplo n.º 4
0
        private async static Task<EpoxyTransport> SetupAsync()
        {
            var transport = new EpoxyTransportBuilder()
                .SetLogSink(new ConsoleLogger())
                .Construct();

            var pingPongService = new PingPongService();
            EpoxyListener pingPongListener = transport.MakeListener(PingEndpoint);
            pingPongListener.AddService(pingPongService);

            var reversePingPongService = new ReversePingPongService();
            EpoxyListener reversePingPongListener = transport.MakeListener(ReversePingEndpoint);
            reversePingPongListener.AddService(reversePingPongService);

            await Task.WhenAll(
                pingPongListener.StartAsync(),
                reversePingPongListener.StartAsync());

            pingConnection = await transport.ConnectToAsync(PingUri);
            reverseConnection = await transport.ConnectToAsync(ReversePingUri);

            return transport;
        }