public PrivateChannel(PrivateStream stream, EndpointIdentifier identifier, MqttConfiguration configuration) { _stream = stream; _identifier = identifier; _receiver = new ReplaySubject <byte[]>(window: TimeSpan.FromSeconds(configuration.WaitTimeoutSecs)); _sender = new ReplaySubject <byte[]>(window: TimeSpan.FromSeconds(configuration.WaitTimeoutSecs)); _streamSubscription = SubscribeStream(); }
public Task <IMqttChannel <byte[]> > CreateAsync() { PrivateStream stream = new PrivateStream(_configuration); _privateStreamListener.OnNext(stream); return(Task.FromResult <IMqttChannel <byte[]> >(new PrivateChannel(stream, _identifier, _configuration))); }