public static CreateClientChannel ( string name, ChannelType type, |
||
name | string | |
type | ChannelType | |
endPoint | ||
outputSource | ||
Результат | Client.IChannel |
private async Task <Client.IChannel> CreateSecondaryClientChannelAsync(string address, bool connected = true) { var channel = ChannelHelper.CreateClientChannel("2", address, _outputSource); if (connected) { await channel.ConnectAsync(); } return(channel); }
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); }