public PrivateChannel(PrivateStream stream, EndpointIdentifier identifier, MqttConfiguration configuration) { this.stream = stream; this.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() { var stream = new PrivateStream(configuration); privateStreamListener.OnNext(stream); return(Task.FromResult <IMqttChannel <byte[]> > (new PrivateChannel(stream, identifier, configuration))); }