Esempio n. 1
0
 MqttStubClient(IActivityMonitor m, MqttConfiguration config, NamedPipeClientStream namedPipeClientStream)
 {
     _m              = m;
     _config         = config;
     _pipe           = namedPipeClientStream;
     _pipeFormatter  = new PipeFormatter(_pipe);
     _listenerCancel = new CancellationTokenSource();
     _listener       = Listen(_listenerCancel.Token);
     _receiver       = new ReplaySubject <MqttApplicationMessage>();
 }
Esempio n. 2
0
 public MqttRelay(IActivityMonitor m, NamedPipeServerStream pipe, MqttClientCredentials credentials, MqttLastWill lastWill, bool cleanSession, IMqttClient client)
 {
     _m                   = m;
     _credentials         = credentials;
     _lastWill            = lastWill;
     _cleanSession        = cleanSession;
     _client              = client;
     _tokenSource         = new CancellationTokenSource();
     _pf                  = new PipeFormatter(pipe);
     _observing           = _client.MessageStream.Subscribe(MessageReceived);
     client.Disconnected += Client_Disconnected;
 }