/// In MQTT 5, user properties are basic UTF-8 string key-value pairs that you can append to almost every type of MQTT packet.
/// As long as you don’t exceed the maximum message size, you can use an unlimited number of user properties to add metadata to MQTT messages and pass information between publisher, broker, and subscriber.
/// The feature is very similar to the HTTP header concept.
/// MQTTv5 only.
/// Gets the user properties.
/// In MQTT 5, user properties are basic UTF-8 string key-value pairs that you can append to almost every type of MQTT
/// packet.
/// As long as you don’t exceed the maximum message size, you can use an unlimited number of user properties to add
/// metadata to MQTT messages and pass information between publisher, broker, and subscriber.
/// The feature is very similar to the HTTP header concept.
/// Authentication data is binary information used to transmit multiple iterations of cryptographic secrets of protocol steps.
/// The content of the authentication data is highly dependent on the specific implementation of the authentication method.
/// Hint: MQTT 5 feature only.
/// </summary>
publicbyte[]AuthenticationData{get;set;}
/// <summary>
/// Gets or sets the user properties.
/// In MQTT 5, user properties are basic UTF-8 string key-value pairs that you can append to almost every type of MQTT packet.
/// As long as you don’t exceed the maximum message size, you can use an unlimited number of user properties to add metadata to MQTT messages and pass information between publisher, broker, and subscriber.
/// The feature is very similar to the HTTP header concept.
_logger.Warning("Client will now throw an _MqttConnectingFailedException_. This is obsolete and will be removed in the future. Consider setting _ThrowOnNonSuccessfulResponseFromServer=False_ in client options.");
_logger.Warning(
"Client will now throw an _MqttConnectingFailedException_. This is obsolete and will be removed in the future. Consider setting _ThrowOnNonSuccessfulResponseFromServer=False_ in client options.");
// await _authenticationHandler.HandleExtendedAuthentication(authPacket, new MqttInitialAuthenticationStrategy(_channelAdapter)).ConfigureAwait(false);
// }
elseif(packetisMqttPingRespPacket)
{
_packetDispatcher.TryDispatch(packet);
}
elseif(packetisMqttPingReqPacket)
{
thrownewMqttProtocolViolationException("The PINGREQ Packet is sent from a Client to the Server only.");
thrownewMqttProtocolViolationException("The PINGREQ packet can only be sent from client to server.");
}
elseif(packetisMqttConnAckPacket)
{
thrownewMqttProtocolViolationException("The CONNACK packet can only be send while connecting.");
}
elseif(packetisMqttConnectPacket)
{
thrownewMqttProtocolViolationException("The CONNECT packet can only be sent from client to server.");
}
else
{
if(!_packetDispatcher.TryDispatch(packet))
{
thrownewMqttProtocolViolationException($"Received packet '{packet}' at an unexpected time.");