示例#1
0
 /// <summary>
 /// Instantiate the <see cref="MqttClientImpl"/> with the given configuration.
 /// </summary>
 /// <param name="config">The configuration to use.</param>
 /// <param name="messageHandler">The delegate that will handle incoming messages. <see cref="MessageHandlerDelegate"/> docs for more info.</param>
 internal MqttClientImpl(ProtocolConfiguration protocolConfig, MqttClientConfiguration config, Func <IActivityMonitor, string, PipeReader, int, QualityOfService, bool, CancellationToken, ValueTask> messageHandler)
     : base(config)
 {
     (_pConfig, _config, _messageHandler) = (protocolConfig, config, messageHandler);
     if (config.WaitTimeoutMilliseconds > config.KeepAliveSeconds && config.KeepAliveSeconds != 0)
     {
         throw new ArgumentException("Wait timeout should be smaller than the keep alive.");
     }
 }
示例#2
0
 /// <summary>
 /// Instantiates a new <see cref="MemoryPacketStore"/>.
 /// </summary>
 /// <param name="config">The configuration of the mqtt client.</param>
 /// <param name="packetIdMaxValue">The maximum id supported by the protocol.</param>
 public MemoryPacketStore(ProtocolConfiguration protocolConfiguration, MqttConfigurationBase config, int packetIdMaxValue)
     : base(packetIdMaxValue, config)
 {
     _protocolConfig = protocolConfiguration;
 }