public TransportChannel( UniqueId connectionId, UniqueId channelId, IWritableChannel <ChannelMessage> output, IChannelHeaderFactory headerFactory) { ConnectionId = connectionId; Id = channelId; _log = LogManager.GetLogger <TransportChannel>($"{connectionId}.{channelId}"); _incomingMessageHandler = new TransportChannelHeaderHandler <Task, ChannelMessage>(HandleIncomingAsync, HandleIncomingAsync, HandleIncomingAsync); _sendProcessor = new TransportChannelSendProcessor(connectionId, channelId, output, headerFactory); Completion = TaskRunner.RunInBackground(ProcessAsync).LogCompletion(_log); }
public TransportChannel( UniqueId connectionId, UniqueId channelId, IWriteOnlyChannel <ChannelMessage> output, IChannelHeaderFactory headerFactory) { ConnectionId = connectionId; Id = channelId; _log = LogManager.GetLogger <TransportChannel>($"{connectionId}.{channelId}"); _incomingMessageHandler = new TransportChannelHeaderHandler <Task, ChannelMessage>(HandleIncomingAsync, HandleIncomingAsync, HandleIncomingAsync); _sendProcessor = new TransportChannelSendProcessor(connectionId, channelId, output, headerFactory); Completion = Task.WhenAll(_sendProcessor.Completion, _receiveBuffer.In.Completion).LogCompletion(_log); }