public static ValueTask <Task <T?> > SendPacket <T>(IActivityMonitor?m, IOutgoingPacketStore store, OutputPump output, IOutgoingPacket packet)
            where T : class
        {
            IDisposableGroup?group = m?.OpenTrace($"Sending a packet '{packet}'in QoS {packet.Qos}");

            return(packet.Qos switch
            {
                QualityOfService.AtMostOnce => PublishQoS0 <T>(m, group, output, packet),
                QualityOfService.AtLeastOnce => StoreAndSend <T>(m, group, output, store, packet, packet.Qos),
                QualityOfService.ExactlyOnce => StoreAndSend <T>(m, group, output, store, packet, packet.Qos),
                _ => throw new ArgumentException("Invalid QoS."),
            });
Example #2
0
 public PublishLifecycleReflex(IIncomingPacketStore packetIdStore, IOutgoingPacketStore store, OutputPump output)
 => (_packetIdStore, _store, _output) = (packetIdStore, store, output);
Example #3
0
 public SubackReflex(IOutgoingPacketStore store)
 {
     _store = store;
 }
 public UnsubackReflex(IOutgoingPacketStore store) => _store = store;
Example #5
0
 public OutputProcessorWithKeepAlive(MqttClientConfiguration config, OutputPump outputPump, PipeWriter pipeWriter, IOutgoingPacketStore store)
     : base(outputPump, pipeWriter, store)
 {
     _config    = config;
     _stopwatch = config.StopwatchFactory.Create();
 }
 public OutputProcessor(OutputPump outputPump, PipeWriter pipeWriter, IOutgoingPacketStore outgoingPacketStore)
 {
     OutputPump           = outputPump;
     _pipeWriter          = pipeWriter;
     _outgoingPacketStore = outgoingPacketStore;
 }
Example #7
0
 public ClientState(InputPump input, OutputPump output, IMqttChannel channel, IIncomingPacketStore packetIdStore, IOutgoingPacketStore store) : base(input, output)
 {
     Channel       = channel;
     PacketIdStore = packetIdStore;
     Store         = store;
 }