Akka.Interfaced.SlimSocket.ChannelTest.CreatePrimaryClientChannelAsync C# (CSharp) Method

CreatePrimaryClientChannelAsync() private method

private CreatePrimaryClientChannelAsync ( ChannelType type, bool connected = true ) : Task
type ChannelType
connected bool
return Task
        private async Task<Client.IChannel> CreatePrimaryClientChannelAsync(ChannelType type, bool connected = true)
        {
            var channel = ChannelHelper.CreateClientChannel("1", type, _testEndPoint, _outputSource);

            channel.ChannelRouter = (_, address) =>
            {
                try
                {
                    return CreateSecondaryClientChannelAsync(address, true).Result;
                }
                catch (Exception)
                {
                    return null;
                }
            };

            if (connected)
                await channel.ConnectAsync();

            return channel;
        }