diff --git a/Source/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs b/Source/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs index 4e06eaf9..720ed127 100644 --- a/Source/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs +++ b/Source/MQTTnet.Extensions.ManagedClient/IManagedMqttClient.cs @@ -16,95 +16,36 @@ namespace MQTTnet.Extensions.ManagedClient /// IMqttClient InternalClient { get; } - /// - /// Gets a value indicating whether the client is started or not. - /// bool IsStarted { get; } - /// - /// Gets a value indicating whether the client is connected or not. - /// bool IsConnected { get; } - /// - /// Gets a pending application message count. - /// int PendingApplicationMessagesCount { get; } - /// - /// Gets the MQTT client options. - /// IManagedMqttClientOptions Options { get; } - /// - /// Gets or sets the connected handler. - /// IMqttClientConnectedHandler ConnectedHandler { get; set; } - /// - /// Gets or sets the disconnected handler. - /// IMqttClientDisconnectedHandler DisconnectedHandler { get; set; } - /// - /// Gets or sets the application message process handler. - /// IApplicationMessageProcessedHandler ApplicationMessageProcessedHandler { get; set; } - /// - /// Gets or sets the application message skipped handler. - /// IApplicationMessageSkippedHandler ApplicationMessageSkippedHandler { get; set; } - /// - /// Gets or sets the connecting failed handler. - /// IConnectingFailedHandler ConnectingFailedHandler { get; set; } - /// - /// Gets or sets the synchronizing subscriptions failed handler. - /// ISynchronizingSubscriptionsFailedHandler SynchronizingSubscriptionsFailedHandler { get; set; } - /// - /// Starts the client. - /// - /// The options. - /// A representing any asynchronous operation. Task StartAsync(IManagedMqttClientOptions options); - /// - /// Stops the client. - /// - /// A representing any asynchronous operation. Task StopAsync(); - /// - /// Pings the server. - /// - /// A token to cancel the task. - /// A representing any asynchronous operation. Task PingAsync(CancellationToken cancellationToken); - /// - /// Subscribes the client. - /// - /// The topic filters. - /// A representing any asynchronous operation. Task SubscribeAsync(IEnumerable topicFilters); - /// - /// Unsubscribes the client. - /// - /// The topics. - /// A representing any asynchronous operation. Task UnsubscribeAsync(IEnumerable topics); - /// - /// Publishes a message from the client. - /// - /// The application messages. - /// A representing any asynchronous operation. Task PublishAsync(ManagedMqttApplicationMessage applicationMessages); } } \ No newline at end of file diff --git a/Source/MQTTnet.Extensions.Rpc/Options/TopicGeneration/TopicGenerationContext.cs b/Source/MQTTnet.Extensions.Rpc/Options/TopicGeneration/TopicGenerationContext.cs index cd82c52a..39110bb4 100644 --- a/Source/MQTTnet.Extensions.Rpc/Options/TopicGeneration/TopicGenerationContext.cs +++ b/Source/MQTTnet.Extensions.Rpc/Options/TopicGeneration/TopicGenerationContext.cs @@ -7,6 +7,14 @@ namespace MQTTnet.Extensions.Rpc.Options.TopicGeneration { public string MethodName { get; set; } + /// + /// Gets or sets the quality of service level. + /// The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. + /// There are 3 QoS levels in MQTT: + /// - At most once (0): Message gets delivered no time, once or multiple times. + /// - At least once (1): Message gets delivered at least once (one time or more often). + /// - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). + /// public MqttQualityOfServiceLevel QualityOfServiceLevel { get; set; } public IMqttClient MqttClient { get; set; } diff --git a/Source/MQTTnet/IApplicationMessagePublisher.cs b/Source/MQTTnet/IApplicationMessagePublisher.cs index aa3caae7..bf17718c 100644 --- a/Source/MQTTnet/IApplicationMessagePublisher.cs +++ b/Source/MQTTnet/IApplicationMessagePublisher.cs @@ -6,12 +6,6 @@ namespace MQTTnet { public interface IApplicationMessagePublisher { - /// - /// Publishes a new application message to the server. - /// - /// The application message. - /// A cancellation token to stop the task. - /// A representing any asynchronous operation. Task PublishAsync(MqttApplicationMessage applicationMessage, CancellationToken cancellationToken); } } diff --git a/Source/MQTTnet/IMqttFactory.cs b/Source/MQTTnet/IMqttFactory.cs index b68e27a9..8c0e5af3 100644 --- a/Source/MQTTnet/IMqttFactory.cs +++ b/Source/MQTTnet/IMqttFactory.cs @@ -7,14 +7,8 @@ namespace MQTTnet { public interface IMqttFactory : IMqttClientFactory, IMqttServerFactory { - /// - /// Gets the default logger. - /// IMqttNetLogger DefaultLogger { get; } - /// - /// Gets the properties. - /// IDictionary Properties { get; } } } diff --git a/Source/MQTTnet/MqttApplicationMessageBuilder.cs b/Source/MQTTnet/MqttApplicationMessageBuilder.cs index e03d2597..f2fc0cd4 100644 --- a/Source/MQTTnet/MqttApplicationMessageBuilder.cs +++ b/Source/MQTTnet/MqttApplicationMessageBuilder.cs @@ -106,33 +106,18 @@ namespace MQTTnet /// Hint: MQTT 5 feature only. private List _userProperties; - /// - /// Adds a topic to the message. - /// - /// The topic. - /// A new instance of the class. public MqttApplicationMessageBuilder WithTopic(string topic) { _topic = topic; return this; } - /// - /// Adds a payload to the message. - /// - /// The payload. - /// A new instance of the class. public MqttApplicationMessageBuilder WithPayload(byte[] payload) { _payload = payload; return this; } - /// - /// Adds a payload to the message. - /// - /// The payload. - /// A new instance of the class. public MqttApplicationMessageBuilder WithPayload(IEnumerable payload) { if (payload == null) @@ -151,11 +136,6 @@ namespace MQTTnet return this; } - /// - /// Adds a payload to the message. - /// - /// The payload. - /// A new instance of the class. public MqttApplicationMessageBuilder WithPayload(Stream payload) { if (payload == null) @@ -167,12 +147,6 @@ namespace MQTTnet return WithPayload(payload, payload.Length - payload.Position); } - /// - /// Adds a payload to the message. - /// - /// The payload. - /// The stream length. - /// A new instance of the class. public MqttApplicationMessageBuilder WithPayload(Stream payload, long length) { if (payload == null) @@ -194,11 +168,6 @@ namespace MQTTnet return this; } - /// - /// Adds a payload to the message. - /// - /// The payload. - /// A new instance of the class. public MqttApplicationMessageBuilder WithPayload(string payload) { if (payload == null) @@ -211,22 +180,12 @@ namespace MQTTnet return this; } - /// - /// Adds the quality of service level to the message. - /// - /// The quality of service level. - /// A new instance of the class. public MqttApplicationMessageBuilder WithQualityOfServiceLevel(MqttQualityOfServiceLevel qualityOfServiceLevel) { _qualityOfServiceLevel = qualityOfServiceLevel; return this; } - /// - /// Adds the quality of service level to the message. - /// - /// The quality of service level. - /// A new instance of the class. public MqttApplicationMessageBuilder WithQualityOfServiceLevel(int qualityOfServiceLevel) { if (qualityOfServiceLevel < 0 || qualityOfServiceLevel > 2) @@ -237,40 +196,24 @@ namespace MQTTnet return WithQualityOfServiceLevel((MqttQualityOfServiceLevel)qualityOfServiceLevel); } - /// - /// Adds retain flag to the message. - /// - /// A new instance of the class. public MqttApplicationMessageBuilder WithRetainFlag(bool value = true) { _retain = value; return this; } - /// - /// Adds the quality of service level 0 (at least once) to the message. - /// - /// A new instance of the class. public MqttApplicationMessageBuilder WithAtLeastOnceQoS() { _qualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce; return this; } - /// - /// Adds the quality of service level 1 (at most once) to the message. - /// - /// A new instance of the class. public MqttApplicationMessageBuilder WithAtMostOnceQoS() { _qualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce; return this; } - /// - /// Adds the quality of service level 2 (exactly once) to the message. - /// - /// A new instance of the class. public MqttApplicationMessageBuilder WithExactlyOnceQoS() { _qualityOfServiceLevel = MqttQualityOfServiceLevel.ExactlyOnce; @@ -383,10 +326,6 @@ namespace MQTTnet return this; } - /// - /// Builds the message. - /// - /// A new instance of the class. public MqttApplicationMessage Build() { if (!_topicAlias.HasValue && string.IsNullOrEmpty(_topic)) diff --git a/Source/MQTTnet/MqttApplicationMessageExtensions.cs b/Source/MQTTnet/MqttApplicationMessageExtensions.cs index 26191240..dac9998a 100644 --- a/Source/MQTTnet/MqttApplicationMessageExtensions.cs +++ b/Source/MQTTnet/MqttApplicationMessageExtensions.cs @@ -5,11 +5,6 @@ namespace MQTTnet { public static class MqttApplicationMessageExtensions { - /// - /// Converts the payload to a string if possible. - /// - /// The application message. - /// A string. public static string ConvertPayloadToString(this MqttApplicationMessage applicationMessage) { if (applicationMessage == null) throw new ArgumentNullException(nameof(applicationMessage)); diff --git a/Source/MQTTnet/MqttApplicationMessageReceivedEventArgs.cs b/Source/MQTTnet/MqttApplicationMessageReceivedEventArgs.cs index ed46305c..ac307de4 100644 --- a/Source/MQTTnet/MqttApplicationMessageReceivedEventArgs.cs +++ b/Source/MQTTnet/MqttApplicationMessageReceivedEventArgs.cs @@ -10,6 +10,10 @@ namespace MQTTnet ApplicationMessage = applicationMessage ?? throw new ArgumentNullException(nameof(applicationMessage)); } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } public MqttApplicationMessage ApplicationMessage { get; } diff --git a/Source/MQTTnet/MqttTopicFilterBuilder.cs b/Source/MQTTnet/MqttTopicFilterBuilder.cs index bcf6efd2..9b4b7abd 100644 --- a/Source/MQTTnet/MqttTopicFilterBuilder.cs +++ b/Source/MQTTnet/MqttTopicFilterBuilder.cs @@ -28,62 +28,36 @@ namespace MQTTnet /// string _topic; - /// - /// Adds a topic to the topic filter. - /// - /// The topic. - /// A new instance of the class. public MqttTopicFilterBuilder WithTopic(string topic) { _topic = topic; return this; } - /// - /// Adds the quality of service level to the topic filter. - /// - /// The quality of service level. - /// A new instance of the class. public MqttTopicFilterBuilder WithQualityOfServiceLevel(MqttQualityOfServiceLevel qualityOfServiceLevel) { _qualityOfServiceLevel = qualityOfServiceLevel; return this; } - /// - /// Adds the quality of service level 0 (at least once) to the topic filter. - /// - /// A new instance of the class. public MqttTopicFilterBuilder WithAtLeastOnceQoS() { _qualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce; return this; } - /// - /// Adds the quality of service level 1 (at most once) to the topic filter. - /// - /// A new instance of the class. public MqttTopicFilterBuilder WithAtMostOnceQoS() { _qualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce; return this; } - /// - /// Adds the quality of service level 2 (exactly once) to the topic filter. - /// - /// A new instance of the class. public MqttTopicFilterBuilder WithExactlyOnceQoS() { _qualityOfServiceLevel = MqttQualityOfServiceLevel.ExactlyOnce; return this; } - /// - /// Builds the topic filter. - /// - /// A new instance of the class. public MqttTopicFilter Build() { if (string.IsNullOrEmpty(_topic)) diff --git a/Source/MQTTnet/Server/CheckSubscriptionsResult.cs b/Source/MQTTnet/Server/CheckSubscriptionsResult.cs index b6e7dbd8..eb66f17e 100644 --- a/Source/MQTTnet/Server/CheckSubscriptionsResult.cs +++ b/Source/MQTTnet/Server/CheckSubscriptionsResult.cs @@ -8,6 +8,14 @@ namespace MQTTnet.Server public bool IsSubscribed { get; set; } + /// + /// Gets or sets the quality of service level. + /// The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. + /// There are 3 QoS levels in MQTT: + /// - At most once (0): Message gets delivered no time, once or multiple times. + /// - At least once (1): Message gets delivered at least once (one time or more often). + /// - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). + /// public MqttQualityOfServiceLevel QualityOfServiceLevel { get; set; } } } diff --git a/Source/MQTTnet/Server/IMqttClientSession.cs b/Source/MQTTnet/Server/IMqttClientSession.cs index d7db2b13..f522df68 100644 --- a/Source/MQTTnet/Server/IMqttClientSession.cs +++ b/Source/MQTTnet/Server/IMqttClientSession.cs @@ -4,6 +4,10 @@ namespace MQTTnet.Server { public interface IMqttClientSession { + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// string ClientId { get; } Task StopAsync(); diff --git a/Source/MQTTnet/Server/IMqttServerFactory.cs b/Source/MQTTnet/Server/IMqttServerFactory.cs index 05090bb7..39efaa3d 100644 --- a/Source/MQTTnet/Server/IMqttServerFactory.cs +++ b/Source/MQTTnet/Server/IMqttServerFactory.cs @@ -7,37 +7,14 @@ namespace MQTTnet.Server { public interface IMqttServerFactory { - /// - /// Gets the default server adapters. - /// IList> DefaultServerAdapters { get; } - /// - /// Creates a new default MQTT server. - /// - /// A new . IMqttServer CreateMqttServer(); - /// - /// Creates a new default MQTT server. - /// - /// The logger. - /// A new . IMqttServer CreateMqttServer(IMqttNetLogger logger); - /// - /// Creates a new default MQTT server. - /// - /// The adapters. - /// A new . IMqttServer CreateMqttServer(IEnumerable adapters); - /// - /// Creates a new default MQTT server. - /// - /// The adapters. - /// The logger. - /// A new . IMqttServer CreateMqttServer(IEnumerable adapters, IMqttNetLogger logger); } } \ No newline at end of file diff --git a/Source/MQTTnet/Server/IMqttServerOptions.cs b/Source/MQTTnet/Server/IMqttServerOptions.cs index 233048e5..cd0cd40b 100644 --- a/Source/MQTTnet/Server/IMqttServerOptions.cs +++ b/Source/MQTTnet/Server/IMqttServerOptions.cs @@ -4,6 +4,10 @@ namespace MQTTnet.Server { public interface IMqttServerOptions { + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// string ClientId { get; set; } bool EnablePersistentSessions { get; } diff --git a/Source/MQTTnet/Server/IMqttServerPersistedSession.cs b/Source/MQTTnet/Server/IMqttServerPersistedSession.cs index 9ca40761..a7b015ef 100644 --- a/Source/MQTTnet/Server/IMqttServerPersistedSession.cs +++ b/Source/MQTTnet/Server/IMqttServerPersistedSession.cs @@ -5,14 +5,26 @@ namespace MQTTnet.Server { public interface IMqttServerPersistedSession { + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// string ClientId { get; } IDictionary Items { get; } IList Subscriptions { get; } + /// + /// Gets the last will message. + /// In MQTT, you use the last will message feature to notify other clients about an ungracefully disconnected client. + /// MqttApplicationMessage WillMessage { get; } + /// + /// Gets the will delay interval. + /// This is the time between the client disconnect and the time the will message will be sent. + /// uint? WillDelayInterval { get; } DateTime? SessionExpiryTimestamp { get; } diff --git a/Source/MQTTnet/Server/MqttApplicationMessageInterceptorContext.cs b/Source/MQTTnet/Server/MqttApplicationMessageInterceptorContext.cs index cde9a855..f606a575 100644 --- a/Source/MQTTnet/Server/MqttApplicationMessageInterceptorContext.cs +++ b/Source/MQTTnet/Server/MqttApplicationMessageInterceptorContext.cs @@ -18,6 +18,10 @@ namespace MQTTnet.Server /// public IMqttNetScopedLogger Logger { get; } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } public MqttApplicationMessage ApplicationMessage { get; set; } diff --git a/Source/MQTTnet/Server/MqttClientMessageQueueInterceptorContext.cs b/Source/MQTTnet/Server/MqttClientMessageQueueInterceptorContext.cs index 209f8c03..881666eb 100644 --- a/Source/MQTTnet/Server/MqttClientMessageQueueInterceptorContext.cs +++ b/Source/MQTTnet/Server/MqttClientMessageQueueInterceptorContext.cs @@ -20,6 +20,14 @@ namespace MQTTnet.Server public bool AcceptEnqueue { get; set; } = true; + /// + /// Gets or sets the supscription quality of service level. + /// The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. + /// There are 3 QoS levels in MQTT: + /// - At most once (0): Message gets delivered no time, once or multiple times. + /// - At least once (1): Message gets delivered at least once (one time or more often). + /// - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). + /// public MqttQualityOfServiceLevel SubscriptionQualityOfServiceLevel { get; set; } } } diff --git a/Source/MQTTnet/Server/MqttConnectionValidatorContext.cs b/Source/MQTTnet/Server/MqttConnectionValidatorContext.cs index 9a5b8b95..e9d6aebc 100644 --- a/Source/MQTTnet/Server/MqttConnectionValidatorContext.cs +++ b/Source/MQTTnet/Server/MqttConnectionValidatorContext.cs @@ -21,6 +21,10 @@ namespace MQTTnet.Server SessionItems = sessionItems; } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId => _connectPacket.ClientId; public string Endpoint => _clientAdapter.Endpoint; @@ -37,30 +41,88 @@ namespace MQTTnet.Server public string Password => Encoding.UTF8.GetString(RawPassword ?? new byte[0]); + /// + /// Gets or sets the will delay interval. + /// This is the time between the client disconnect and the time the will message will be sent. + /// public MqttApplicationMessage WillMessage => _connectPacket?.WillMessage; + /// + /// Gets or sets a value indicating whether clean sessions are used or not. + /// When a client connects to a broker it can connect using either a non persistent connection (clean session) or a persistent connection. + /// With a non persistent connection the broker doesn't store any subscription information or undelivered messages for the client. + /// This mode is ideal when the client only publishes messages. + /// It can also connect as a durable client using a persistent connection. + /// In this mode, the broker will store subscription information, and undelivered messages for the client. + /// public bool? CleanSession => _connectPacket?.CleanSession; + /// + /// Gets or sets the keep alive period. + /// The connection is normally left open by the client so that is can send and receive data at any time. + /// If no data flows over an open connection for a certain time period then the client will generate a PINGREQ and expect to receive a PINGRESP from the broker. + /// This message exchange confirms that the connection is open and working. + /// This period is known as the keep alive period. + /// public ushort? KeepAlivePeriod => _connectPacket?.KeepAlivePeriod; + /// + /// 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. + /// Hint: MQTT 5 feature only. + /// public List UserProperties => _connectPacket?.Properties?.UserProperties; + /// + /// Gets or sets the authentication data. + /// Hint: MQTT 5 feature only. + /// public byte[] AuthenticationData => _connectPacket?.Properties?.AuthenticationData; + /// + /// Gets or sets the authentication method. + /// Hint: MQTT 5 feature only. + /// public string AuthenticationMethod => _connectPacket?.Properties?.AuthenticationMethod; public uint? MaximumPacketSize => _connectPacket?.Properties?.MaximumPacketSize; + /// + /// Gets or sets the receive maximum. + /// This gives the maximum length of the receive messages. + /// public ushort? ReceiveMaximum => _connectPacket?.Properties?.ReceiveMaximum; + /// + /// Gets or sets the topic alias maximum. + /// This gives the maximum length of the topic alias. + /// public ushort? TopicAliasMaximum => _connectPacket?.Properties?.TopicAliasMaximum; + /// + /// Gets the request problem information. + /// Hint: MQTT 5 feature only. + /// public bool? RequestProblemInformation => _connectPacket?.Properties?.RequestProblemInformation; + /// + /// Gets the request response information. + /// Hint: MQTT 5 feature only. + /// public bool? RequestResponseInformation => _connectPacket?.Properties?.RequestResponseInformation; + /// + /// Gets the session expiry interval. + /// The time after a session expires when it's not actively used. + /// public uint? SessionExpiryInterval => _connectPacket?.Properties?.SessionExpiryInterval; + /// + /// Gets or sets the will delay interval. + /// This is the time between the client disconnect and the time the will message will be sent. + /// public uint? WillDelayInterval => _connectPacket?.Properties?.WillDelayInterval; /// @@ -79,14 +141,26 @@ namespace MQTTnet.Server } /// - /// This is used for MQTTv5 only. When a MQTTv3 client connects the enum value must be one which is + /// Gets or sets the reason code. When a MQTTv3 client connects the enum value must be one which is /// also supported in MQTTv3. Otherwise the connection attempt will fail because not all codes can be /// converted properly. + /// Hint: MQTT 5 feature only. /// public MqttConnectReasonCode ReasonCode { get; set; } = MqttConnectReasonCode.Success; + /// + /// Gets or sets the response 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. + /// Hint: MQTT 5 feature only. + /// public List ResponseUserProperties { get; set; } + /// + /// Gets or sets the response authentication data. + /// Hint: MQTT 5 feature only. + /// public byte[] ResponseAuthenticationData { get; set; } public string AssignedClientIdentifier { get; set; } diff --git a/Source/MQTTnet/Server/MqttQueuedApplicationMessage.cs b/Source/MQTTnet/Server/MqttQueuedApplicationMessage.cs index 635894b3..5ca163dc 100644 --- a/Source/MQTTnet/Server/MqttQueuedApplicationMessage.cs +++ b/Source/MQTTnet/Server/MqttQueuedApplicationMessage.cs @@ -11,6 +11,14 @@ namespace MQTTnet.Server public bool IsRetainedMessage { get; set; } + /// + /// Gets or sets the subscription quality of service level. + /// The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. + /// There are 3 QoS levels in MQTT: + /// - At most once (0): Message gets delivered no time, once or multiple times. + /// - At least once (1): Message gets delivered at least once (one time or more often). + /// - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). + /// public MqttQualityOfServiceLevel SubscriptionQualityOfServiceLevel { get; set; } [Obsolete("Use 'SubscriptionQualityOfServiceLevel' instead.")] diff --git a/Source/MQTTnet/Server/MqttServerClientConnectedEventArgs.cs b/Source/MQTTnet/Server/MqttServerClientConnectedEventArgs.cs index 71c42c3e..88f0c558 100644 --- a/Source/MQTTnet/Server/MqttServerClientConnectedEventArgs.cs +++ b/Source/MQTTnet/Server/MqttServerClientConnectedEventArgs.cs @@ -9,6 +9,10 @@ namespace MQTTnet.Server ClientId = clientId ?? throw new ArgumentNullException(nameof(clientId)); } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } } } diff --git a/Source/MQTTnet/Server/MqttServerClientDisconnectedEventArgs.cs b/Source/MQTTnet/Server/MqttServerClientDisconnectedEventArgs.cs index 9e742749..d2e7fe55 100644 --- a/Source/MQTTnet/Server/MqttServerClientDisconnectedEventArgs.cs +++ b/Source/MQTTnet/Server/MqttServerClientDisconnectedEventArgs.cs @@ -9,7 +9,11 @@ namespace MQTTnet.Server ClientId = clientId ?? throw new ArgumentNullException(nameof(clientId)); DisconnectType = disconnectType; } - + + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } public MqttClientDisconnectType DisconnectType { get; } diff --git a/Source/MQTTnet/Server/MqttServerClientSubscribedTopicEventArgs.cs b/Source/MQTTnet/Server/MqttServerClientSubscribedTopicEventArgs.cs index 94d6e264..3586b731 100644 --- a/Source/MQTTnet/Server/MqttServerClientSubscribedTopicEventArgs.cs +++ b/Source/MQTTnet/Server/MqttServerClientSubscribedTopicEventArgs.cs @@ -10,8 +10,16 @@ namespace MQTTnet.Server TopicFilter = topicFilter ?? throw new ArgumentNullException(nameof(topicFilter)); } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } + /// + /// Gets the topic filter. + /// The topic filter can contain topics and wildcards. + /// public MqttTopicFilter TopicFilter { get; } } } diff --git a/Source/MQTTnet/Server/MqttServerClientUnsubscribedTopicEventArgs.cs b/Source/MQTTnet/Server/MqttServerClientUnsubscribedTopicEventArgs.cs index bb78bb28..8ed1264f 100644 --- a/Source/MQTTnet/Server/MqttServerClientUnsubscribedTopicEventArgs.cs +++ b/Source/MQTTnet/Server/MqttServerClientUnsubscribedTopicEventArgs.cs @@ -10,8 +10,16 @@ namespace MQTTnet.Server TopicFilter = topicFilter ?? throw new ArgumentNullException(nameof(topicFilter)); } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } + /// + /// Gets or sets the topic filter. + /// The topic filter can contain topics and wildcards. + /// public string TopicFilter { get; } } } diff --git a/Source/MQTTnet/Server/MqttServerOptions.cs b/Source/MQTTnet/Server/MqttServerOptions.cs index 31f56e5d..ab52813d 100644 --- a/Source/MQTTnet/Server/MqttServerOptions.cs +++ b/Source/MQTTnet/Server/MqttServerOptions.cs @@ -8,6 +8,10 @@ namespace MQTTnet.Server public MqttServerTlsTcpEndpointOptions TlsEndpointOptions { get; } = new MqttServerTlsTcpEndpointOptions(); + /// + /// Gets or sets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; set; } public bool EnablePersistentSessions { get; set; } diff --git a/Source/MQTTnet/Server/MqttSubscriptionInterceptorContext.cs b/Source/MQTTnet/Server/MqttSubscriptionInterceptorContext.cs index 0d800c85..cc186e53 100644 --- a/Source/MQTTnet/Server/MqttSubscriptionInterceptorContext.cs +++ b/Source/MQTTnet/Server/MqttSubscriptionInterceptorContext.cs @@ -11,8 +11,16 @@ namespace MQTTnet.Server SessionItems = sessionItems; } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } + /// + /// Gets or sets the topic filter. + /// The topic filter can contain topics and wildcards. + /// public MqttTopicFilter TopicFilter { get; set; } /// diff --git a/Source/MQTTnet/Server/MqttUnsubscriptionInterceptorContext.cs b/Source/MQTTnet/Server/MqttUnsubscriptionInterceptorContext.cs index b33cbac6..e5f8d755 100644 --- a/Source/MQTTnet/Server/MqttUnsubscriptionInterceptorContext.cs +++ b/Source/MQTTnet/Server/MqttUnsubscriptionInterceptorContext.cs @@ -11,8 +11,17 @@ namespace MQTTnet.Server SessionItems = sessionItems; } + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; } + /// + /// Gets or sets the MQTT topic. + /// In MQTT, the word topic refers to an UTF-8 string that the broker uses to filter messages for each connected client. + /// The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator). + /// public string Topic { get; set; } /// diff --git a/Source/MQTTnet/Server/Status/IMqttClientStatus.cs b/Source/MQTTnet/Server/Status/IMqttClientStatus.cs index d7debdc6..c080b510 100644 --- a/Source/MQTTnet/Server/Status/IMqttClientStatus.cs +++ b/Source/MQTTnet/Server/Status/IMqttClientStatus.cs @@ -6,6 +6,10 @@ namespace MQTTnet.Server.Status { public interface IMqttClientStatus { + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// string ClientId { get; } string Endpoint { get; } diff --git a/Source/MQTTnet/Server/Status/IMqttSessionStatus.cs b/Source/MQTTnet/Server/Status/IMqttSessionStatus.cs index 2ff996b1..115da130 100644 --- a/Source/MQTTnet/Server/Status/IMqttSessionStatus.cs +++ b/Source/MQTTnet/Server/Status/IMqttSessionStatus.cs @@ -5,6 +5,10 @@ namespace MQTTnet.Server.Status { public interface IMqttSessionStatus { + /// + /// Gets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// string ClientId { get; } long PendingApplicationMessagesCount { get; } diff --git a/Source/MQTTnet/Server/Status/MqttClientStatus.cs b/Source/MQTTnet/Server/Status/MqttClientStatus.cs index 9acfea3e..eca5d1a5 100644 --- a/Source/MQTTnet/Server/Status/MqttClientStatus.cs +++ b/Source/MQTTnet/Server/Status/MqttClientStatus.cs @@ -14,6 +14,10 @@ namespace MQTTnet.Server.Status _connection = connection ?? throw new ArgumentNullException(nameof(connection)); } + /// + /// Gets or sets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; set; } public string Endpoint { get; set; } diff --git a/Source/MQTTnet/Server/Status/MqttSessionStatus.cs b/Source/MQTTnet/Server/Status/MqttSessionStatus.cs index a523a37e..af5a6e88 100644 --- a/Source/MQTTnet/Server/Status/MqttSessionStatus.cs +++ b/Source/MQTTnet/Server/Status/MqttSessionStatus.cs @@ -15,6 +15,10 @@ namespace MQTTnet.Server.Status _sessionsManager = sessionsManager ?? throw new ArgumentNullException(nameof(sessionsManager)); } + /// + /// Gets or sets the client identifier. + /// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. + /// public string ClientId { get; set; } public long PendingApplicationMessagesCount { get; set; }