Removed not needed comments on client side (Server side is still missing).

This commit is contained in:
SeppPenner
2021-01-15 19:41:45 +01:00
parent 2047f44554
commit 5eab337e13
16 changed files with 0 additions and 404 deletions
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.Connecting
{ {
public interface IMqttClientConnectedHandler public interface IMqttClientConnectedHandler
{ {
/// <summary>
/// Handles the events when a client gets connected.
/// </summary>
/// <param name="eventArgs">The event args.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task HandleConnectedAsync(MqttClientConnectedEventArgs eventArgs); Task HandleConnectedAsync(MqttClientConnectedEventArgs eventArgs);
} }
} }
@@ -13,24 +13,12 @@ namespace MQTTnet.Client.Connecting
/// </summary> /// </summary>
public MqttClientConnectResultCode ResultCode { get; set; } public MqttClientConnectResultCode ResultCode { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the session is present or not.
/// </summary>
public bool IsSessionPresent { get; set; } public bool IsSessionPresent { get; set; }
/// <summary>
/// Gets or sets a value indicating whether wildcard subscriptions are available.
/// </summary>
public bool? WildcardSubscriptionAvailable { get; set; } public bool? WildcardSubscriptionAvailable { get; set; }
/// <summary>
/// Gets or sets a value indicating whether retained messages are available.
/// </summary>
public bool? RetainAvailable { get; set; } public bool? RetainAvailable { get; set; }
/// <summary>
/// Gets or sets the assigned client identifier.
/// </summary>
public string AssignedClientIdentifier { get; set; } public string AssignedClientIdentifier { get; set; }
/// <summary> /// <summary>
@@ -45,9 +33,6 @@ namespace MQTTnet.Client.Connecting
/// </summary> /// </summary>
public byte[] AuthenticationData { get; set; } public byte[] AuthenticationData { get; set; }
/// <summary>
/// Gets or sets the maximum packet size.
/// </summary>
public uint? MaximumPacketSize { get; set; } public uint? MaximumPacketSize { get; set; }
/// <summary> /// <summary>
@@ -56,14 +41,8 @@ namespace MQTTnet.Client.Connecting
/// </summary> /// </summary>
public string ReasonString { get; set; } public string ReasonString { get; set; }
/// <summary>
/// Gets or sets the receive maximum.
/// </summary>
public ushort? ReceiveMaximum { get; set; } public ushort? ReceiveMaximum { get; set; }
/// <summary>
/// Gets or sets the maximum quality od service level.
/// </summary>
public MqttQualityOfServiceLevel MaximumQoS { get; set; } public MqttQualityOfServiceLevel MaximumQoS { get; set; }
/// <summary> /// <summary>
@@ -72,24 +51,12 @@ namespace MQTTnet.Client.Connecting
/// </summary> /// </summary>
public string ResponseInformation { get; set; } public string ResponseInformation { get; set; }
/// <summary>
/// Gets or sets the topic alias maximum.
/// </summary>
public ushort? TopicAliasMaximum { get; set; } public ushort? TopicAliasMaximum { get; set; }
/// <summary>
/// Gets or sets the server reference.
/// </summary>
public string ServerReference { get; set; } public string ServerReference { get; set; }
/// <summary>
/// Gets or sets the server keep alive.
/// </summary>
public ushort? ServerKeepAlive { get; set; } public ushort? ServerKeepAlive { get; set; }
/// <summary>
/// Gets or sets the session expiry interval.
/// </summary>
public uint? SessionExpiryInterval { get; set; } public uint? SessionExpiryInterval { get; set; }
/// <summary> /// <summary>
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.Disconnecting
{ {
public interface IMqttClientDisconnectedHandler public interface IMqttClientDisconnectedHandler
{ {
/// <summary>
/// Handles the events when a client gets disconnected.
/// </summary>
/// <param name="eventArgs">The event args.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task HandleDisconnectedAsync(MqttClientDisconnectedEventArgs eventArgs); Task HandleDisconnectedAsync(MqttClientDisconnectedEventArgs eventArgs);
} }
} }
@@ -15,14 +15,8 @@ namespace MQTTnet.Client.Disconnecting
ReasonCode = reason; ReasonCode = reason;
} }
/// <summary>
/// Gets a value indicating whether the client was connected or not.
/// </summary>
public bool ClientWasConnected { get; } public bool ClientWasConnected { get; }
/// <summary>
/// Gets the exception.
/// </summary>
public Exception Exception { get; } public Exception Exception { get; }
/// <summary> /// <summary>
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.ExtendedAuthenticationExchange
{ {
public interface IMqttExtendedAuthenticationExchangeHandler public interface IMqttExtendedAuthenticationExchangeHandler
{ {
/// <summary>
/// Handles the authentication request.
/// </summary>
/// <param name="context">The context.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task HandleRequestAsync(MqttExtendedAuthenticationExchangeContext context); Task HandleRequestAsync(MqttExtendedAuthenticationExchangeContext context);
} }
} }
@@ -53,9 +53,6 @@ namespace MQTTnet.Client.ExtendedAuthenticationExchange
/// </summary> /// </summary>
public List<MqttUserProperty> UserProperties { get; } public List<MqttUserProperty> UserProperties { get; }
/// <summary>
/// Gets the client.
/// </summary>
public IMqttClient Client { get; } public IMqttClient Client { get; }
} }
} }
-32
View File
@@ -12,9 +12,6 @@ namespace MQTTnet.Client
{ {
public interface IMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable public interface IMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable
{ {
/// <summary>
/// Gets a value indicating whether the client is connected or not.
/// </summary>
bool IsConnected { get; } bool IsConnected { get; }
/// <summary> /// <summary>
@@ -35,27 +32,10 @@ namespace MQTTnet.Client
/// </summary> /// </summary>
IMqttClientDisconnectedHandler DisconnectedHandler { get; set; } IMqttClientDisconnectedHandler DisconnectedHandler { get; set; }
/// <summary>
/// Connects the client to the server using the specified options.
/// </summary>
/// <param name="options">The options that can be used on connect.</param>
/// <param name="cancellationToken">A cancellation token to stop the task.</param>
/// <returns>A result containing the authentication result information.</returns>
Task<MqttClientAuthenticateResult> ConnectAsync(IMqttClientOptions options, CancellationToken cancellationToken); Task<MqttClientAuthenticateResult> ConnectAsync(IMqttClientOptions options, CancellationToken cancellationToken);
/// <summary>
/// Disconnects the client from the server.
/// </summary>
/// <param name="options">The options containing a disconnect reason.</param>
/// <param name="cancellationToken">A cancellation token to stop the task.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task DisconnectAsync(MqttClientDisconnectOptions options, CancellationToken cancellationToken); Task DisconnectAsync(MqttClientDisconnectOptions options, CancellationToken cancellationToken);
/// <summary>
/// Pings the server.
/// </summary>
/// <param name="cancellationToken">A cancellation token to stop the task.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task PingAsync(CancellationToken cancellationToken); Task PingAsync(CancellationToken cancellationToken);
/// <summary> /// <summary>
@@ -67,20 +47,8 @@ namespace MQTTnet.Client
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> /// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task SendExtendedAuthenticationExchangeDataAsync(MqttExtendedAuthenticationExchangeData data, CancellationToken cancellationToken); Task SendExtendedAuthenticationExchangeDataAsync(MqttExtendedAuthenticationExchangeData data, CancellationToken cancellationToken);
/// <summary>
/// Subscribes the client to topics.
/// </summary>
/// <param name="options">The subscription options.</param>
/// <param name="cancellationToken">A cancellation token to stop the task.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task<MqttClientSubscribeResult> SubscribeAsync(MqttClientSubscribeOptions options, CancellationToken cancellationToken); Task<MqttClientSubscribeResult> SubscribeAsync(MqttClientSubscribeOptions options, CancellationToken cancellationToken);
/// <summary>
/// Unsubscribes the client from topics.
/// </summary>
/// <param name="options">The unsubscription options.</param>
/// <param name="cancellationToken">A cancellation token to stop the task.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task<MqttClientUnsubscribeResult> UnsubscribeAsync(MqttClientUnsubscribeOptions options, CancellationToken cancellationToken); Task<MqttClientUnsubscribeResult> UnsubscribeAsync(MqttClientUnsubscribeOptions options, CancellationToken cancellationToken);
} }
} }
@@ -6,67 +6,22 @@ namespace MQTTnet.Client
{ {
public interface IMqttClientFactory public interface IMqttClientFactory
{ {
/// <summary>
/// A method to tell the client to use the adapter factory.
/// </summary>
/// <param name="clientAdapterFactory">The client adapter factory.</param>
/// <returns>A new <see cref="IMqttFactory"/>.</returns>
IMqttFactory UseClientAdapterFactory(IMqttClientAdapterFactory clientAdapterFactory); IMqttFactory UseClientAdapterFactory(IMqttClientAdapterFactory clientAdapterFactory);
/// <summary>
/// Creates a new low level MQTT client.
/// </summary>
/// <returns>A new <see cref="ILowLevelMqttClient"/>.</returns>
ILowLevelMqttClient CreateLowLevelMqttClient(); ILowLevelMqttClient CreateLowLevelMqttClient();
/// <summary>
/// Creates a new low level MQTT client.
/// </summary>
/// <param name="logger">The logger.</param>
/// <returns>A new <see cref="ILowLevelMqttClient"/>.</returns>
ILowLevelMqttClient CreateLowLevelMqttClient(IMqttNetLogger logger); ILowLevelMqttClient CreateLowLevelMqttClient(IMqttNetLogger logger);
/// <summary>
/// Creates a new low level MQTT client.
/// </summary>
/// <param name="clientAdapterFactory">The client adapter factory.</param>
/// <returns>A new <see cref="ILowLevelMqttClient"/>.</returns>
ILowLevelMqttClient CreateLowLevelMqttClient(IMqttClientAdapterFactory clientAdapterFactory); ILowLevelMqttClient CreateLowLevelMqttClient(IMqttClientAdapterFactory clientAdapterFactory);
/// <summary>
/// Creates a new low level MQTT client.
/// </summary>
/// <param name="logger">The logger.</param>
/// <param name="clientAdapterFactory">The client adapter factory.</param>
/// <returns>A new <see cref="ILowLevelMqttClient"/>.</returns>
ILowLevelMqttClient CreateLowLevelMqttClient(IMqttNetLogger logger, IMqttClientAdapterFactory clientAdapterFactory); ILowLevelMqttClient CreateLowLevelMqttClient(IMqttNetLogger logger, IMqttClientAdapterFactory clientAdapterFactory);
/// <summary>
/// Creates a new MQTT client.
/// </summary>
/// <returns>A new <see cref="IMqttClient"/>.</returns>
IMqttClient CreateMqttClient(); IMqttClient CreateMqttClient();
/// <summary>
/// Creates a new MQTT client.
/// </summary>
/// <param name="logger">The logger.</param>
/// <returns>A new <see cref="IMqttClient"/>.</returns>
IMqttClient CreateMqttClient(IMqttNetLogger logger); IMqttClient CreateMqttClient(IMqttNetLogger logger);
/// <summary>
/// Creates a new MQTT client.
/// </summary>
/// <param name="adapterFactory">The adapter factory.</param>
/// <returns>A new <see cref="IMqttClient"/>.</returns>
IMqttClient CreateMqttClient(IMqttClientAdapterFactory adapterFactory); IMqttClient CreateMqttClient(IMqttClientAdapterFactory adapterFactory);
/// <summary>
/// Creates a new MQTT client.
/// </summary>
/// <param name="logger">The logger.</param>
/// <param name="adapterFactory">The adapter factory.</param>
/// <returns>A new <see cref="IMqttClient"/>.</returns>
IMqttClient CreateMqttClient(IMqttNetLogger logger, IMqttClientAdapterFactory adapterFactory); IMqttClient CreateMqttClient(IMqttNetLogger logger, IMqttClientAdapterFactory adapterFactory);
} }
} }
@@ -24,29 +24,14 @@ namespace MQTTnet.Client.Options
/// </summary> /// </summary>
bool CleanSession { get; } bool CleanSession { get; }
/// <summary>
/// Gets the credentials.
/// </summary>
IMqttClientCredentials Credentials { get; } IMqttClientCredentials Credentials { get; }
/// <summary>
/// Gets the extended authentication exchange handler.
/// </summary>
IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; } IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; }
/// <summary>
/// Gets the protocol version.
/// </summary>
MqttProtocolVersion ProtocolVersion { get; } MqttProtocolVersion ProtocolVersion { get; }
/// <summary>
/// Gets the channel options.
/// </summary>
IMqttClientChannelOptions ChannelOptions { get; } IMqttClientChannelOptions ChannelOptions { get; }
/// <summary>
/// Gets the timeout the communication uses.
/// </summary>
TimeSpan CommunicationTimeout { get; } TimeSpan CommunicationTimeout { get; }
/// <summary> /// <summary>
@@ -82,9 +67,6 @@ namespace MQTTnet.Client.Options
/// </summary> /// </summary>
byte[] AuthenticationData { get; } byte[] AuthenticationData { get; }
/// <summary>
/// Gets the maximum packet size.
/// </summary>
uint? MaximumPacketSize { get; } uint? MaximumPacketSize { get; }
/// <summary> /// <summary>
@@ -5,24 +5,12 @@ namespace MQTTnet.Client.Options
{ {
public class MqttClientCertificateValidationCallbackContext public class MqttClientCertificateValidationCallbackContext
{ {
/// <summary>
/// Gets or sets the certificate.
/// </summary>
public X509Certificate Certificate { get; set; } public X509Certificate Certificate { get; set; }
/// <summary>
/// Gets or sets the certificate chain.
/// </summary>
public X509Chain Chain { get; set; } public X509Chain Chain { get; set; }
/// <summary>
/// Gets or sets the SSL policy errors.
/// </summary>
public SslPolicyErrors SslPolicyErrors { get; set; } public SslPolicyErrors SslPolicyErrors { get; set; }
/// <summary>
/// Gets or sets the client options.
/// </summary>
public IMqttClientChannelOptions ClientOptions { get; set; } public IMqttClientChannelOptions ClientOptions { get; set; }
} }
} }
@@ -24,29 +24,14 @@ namespace MQTTnet.Client.Options
/// </summary> /// </summary>
public bool CleanSession { get; set; } = true; public bool CleanSession { get; set; } = true;
/// <summary>
/// Gets or sets the credentials.
/// </summary>
public IMqttClientCredentials Credentials { get; set; } public IMqttClientCredentials Credentials { get; set; }
/// <summary>
/// Gets or sets the extended authentication exchange handler.
/// </summary>
public IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; set; } public IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; set; }
/// <summary>
/// Gets or sets the protocol version.
/// </summary>
public MqttProtocolVersion ProtocolVersion { get; set; } = MqttProtocolVersion.V311; public MqttProtocolVersion ProtocolVersion { get; set; } = MqttProtocolVersion.V311;
/// <summary>
/// Gets or sets the channel options.
/// </summary>
public IMqttClientChannelOptions ChannelOptions { get; set; } public IMqttClientChannelOptions ChannelOptions { get; set; }
/// <summary>
/// Gets or sets the timeout the communication uses.
/// </summary>
public TimeSpan CommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10); public TimeSpan CommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10);
/// <summary> /// <summary>
@@ -82,9 +67,6 @@ namespace MQTTnet.Client.Options
/// </summary> /// </summary>
public byte[] AuthenticationData { get; set; } public byte[] AuthenticationData { get; set; }
/// <summary>
/// Gets or sets the maximum packet size.
/// </summary>
public uint? MaximumPacketSize { get; set; } public uint? MaximumPacketSize { get; set; }
/// <summary> /// <summary>
@@ -17,11 +17,6 @@ namespace MQTTnet.Client.Options
MqttClientOptionsBuilderTlsParameters _tlsParameters; MqttClientOptionsBuilderTlsParameters _tlsParameters;
MqttClientWebSocketProxyOptions _proxyOptions; MqttClientWebSocketProxyOptions _proxyOptions;
/// <summary>
/// Adds the protocol version to the MQTT client options.
/// </summary>
/// <param name="value">The protocol version.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithProtocolVersion(MqttProtocolVersion value) public MqttClientOptionsBuilder WithProtocolVersion(MqttProtocolVersion value)
{ {
if (value == MqttProtocolVersion.Unknown) if (value == MqttProtocolVersion.Unknown)
@@ -33,88 +28,47 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds the communication timeout to the MQTT client options.
/// </summary>
/// <param name="value">The timeout.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithCommunicationTimeout(TimeSpan value) public MqttClientOptionsBuilder WithCommunicationTimeout(TimeSpan value)
{ {
_options.CommunicationTimeout = value; _options.CommunicationTimeout = value;
return this; return this;
} }
/// <summary>
/// Adds the clean session flag to the MQTT client options.
/// </summary>
/// <param name="value">The clean session flag.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithCleanSession(bool value = true) public MqttClientOptionsBuilder WithCleanSession(bool value = true)
{ {
_options.CleanSession = value; _options.CleanSession = value;
return this; return this;
} }
/// <summary>
/// Adds the keep alive send interval to the MQTT client options.
/// </summary>
/// <param name="value">The keep alive interval.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
[Obsolete("This method is no longer supported. The client will send ping requests just before the keep alive interval is going to elapse. As per MQTT RFC the serve has to wait 1.5 times the interval so we don't need this anymore.")] [Obsolete("This method is no longer supported. The client will send ping requests just before the keep alive interval is going to elapse. As per MQTT RFC the serve has to wait 1.5 times the interval so we don't need this anymore.")]
public MqttClientOptionsBuilder WithKeepAliveSendInterval(TimeSpan value) public MqttClientOptionsBuilder WithKeepAliveSendInterval(TimeSpan value)
{ {
return this; return this;
} }
/// <summary>
/// Adds no keep alive period to the MQTT client options.
/// </summary>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithNoKeepAlive() public MqttClientOptionsBuilder WithNoKeepAlive()
{ {
return WithKeepAlivePeriod(TimeSpan.Zero); return WithKeepAlivePeriod(TimeSpan.Zero);
} }
/// <summary>
/// Adds the keep alive period to the MQTT client options.
/// </summary>
/// <param name="value">The keep alive period.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithKeepAlivePeriod(TimeSpan value) public MqttClientOptionsBuilder WithKeepAlivePeriod(TimeSpan value)
{ {
_options.KeepAlivePeriod = value; _options.KeepAlivePeriod = value;
return this; return this;
} }
/// <summary>
/// Adds the client identifier to the MQTT client options.
/// </summary>
/// <param name="value">The client identifier.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithClientId(string value) public MqttClientOptionsBuilder WithClientId(string value)
{ {
_options.ClientId = value; _options.ClientId = value;
return this; return this;
} }
/// <summary>
/// Adds the will message to the MQTT client options.
/// </summary>
/// <param name="value">The will message.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithWillMessage(MqttApplicationMessage value) public MqttClientOptionsBuilder WithWillMessage(MqttApplicationMessage value)
{ {
_options.WillMessage = value; _options.WillMessage = value;
return this; return this;
} }
/// <summary>
/// Adds the authentication to the MQTT client options.
/// Hint: MQTT 5 feature only.
/// </summary>
/// <param name="method">The authentication method.</param>
/// <param name="data">The data.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithAuthentication(string method, byte[] data) public MqttClientOptionsBuilder WithAuthentication(string method, byte[] data)
{ {
_options.AuthenticationMethod = method; _options.AuthenticationMethod = method;
@@ -122,92 +76,48 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds the will delay interval to the MQTT client options.
/// </summary>
/// <param name="willDelayInterval">The will delay interval.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithWillDelayInterval(uint? willDelayInterval) public MqttClientOptionsBuilder WithWillDelayInterval(uint? willDelayInterval)
{ {
_options.WillDelayInterval = willDelayInterval; _options.WillDelayInterval = willDelayInterval;
return this; return this;
} }
/// <summary>
/// Adds the topic alias maximum to the MQTT client options.
/// </summary>
/// <param name="topicAliasMaximum">The topic alias maximum.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithTopicAliasMaximum(ushort? topicAliasMaximum) public MqttClientOptionsBuilder WithTopicAliasMaximum(ushort? topicAliasMaximum)
{ {
_options.TopicAliasMaximum = topicAliasMaximum; _options.TopicAliasMaximum = topicAliasMaximum;
return this; return this;
} }
/// <summary>
/// Adds the maximum packet size to the MQTT client options.
/// </summary>
/// <param name="maximumPacketSize">The maximum packet size.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithMaximumPacketSize(uint? maximumPacketSize) public MqttClientOptionsBuilder WithMaximumPacketSize(uint? maximumPacketSize)
{ {
_options.MaximumPacketSize = maximumPacketSize; _options.MaximumPacketSize = maximumPacketSize;
return this; return this;
} }
/// <summary>
/// Adds the receive maximum to the MQTT client options.
/// </summary>
/// <param name="receiveMaximum">The receive maximum.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithReceiveMaximum(ushort? receiveMaximum) public MqttClientOptionsBuilder WithReceiveMaximum(ushort? receiveMaximum)
{ {
_options.ReceiveMaximum = receiveMaximum; _options.ReceiveMaximum = receiveMaximum;
return this; return this;
} }
/// <summary>
/// Adds the request problem information to the MQTT client options.
/// Hint: MQTT 5 feature only.
/// </summary>
/// <param name="requestProblemInformation">The request problem information.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithRequestProblemInformation(bool? requestProblemInformation = true) public MqttClientOptionsBuilder WithRequestProblemInformation(bool? requestProblemInformation = true)
{ {
_options.RequestProblemInformation = requestProblemInformation; _options.RequestProblemInformation = requestProblemInformation;
return this; return this;
} }
/// <summary>
/// Adds the request response information to the MQTT client options.
/// Hint: MQTT 5 feature only.
/// </summary>
/// <param name="requestResponseInformation">The request response information.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithRequestResponseInformation(bool? requestResponseInformation = true) public MqttClientOptionsBuilder WithRequestResponseInformation(bool? requestResponseInformation = true)
{ {
_options.RequestResponseInformation = requestResponseInformation; _options.RequestResponseInformation = requestResponseInformation;
return this; return this;
} }
/// <summary>
/// Adds the session expiry interval to the MQTT client options.
/// </summary>
/// <param name="sessionExpiryInterval">The session expiry interval.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithSessionExpiryInterval(uint? sessionExpiryInterval) public MqttClientOptionsBuilder WithSessionExpiryInterval(uint? sessionExpiryInterval)
{ {
_options.SessionExpiryInterval = sessionExpiryInterval; _options.SessionExpiryInterval = sessionExpiryInterval;
return this; return this;
} }
/// <summary>
/// Adds the user property to the MQTT client options.
/// Hint: MQTT 5 feature only.
/// </summary>
/// <param name="name">The user property name.</param>
/// <param name="value">The user property value.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithUserProperty(string name, string value) public MqttClientOptionsBuilder WithUserProperty(string name, string value)
{ {
if (name is null) throw new ArgumentNullException(nameof(name)); if (name is null) throw new ArgumentNullException(nameof(name));
@@ -222,12 +132,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds the credentials to the MQTT client options.
/// </summary>
/// <param name="username">The user name.</param>
/// <param name="password">The password.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithCredentials(string username, string password = null) public MqttClientOptionsBuilder WithCredentials(string username, string password = null)
{ {
byte[] passwordBuffer = null; byte[] passwordBuffer = null;
@@ -240,12 +144,6 @@ namespace MQTTnet.Client.Options
return WithCredentials(username, passwordBuffer); return WithCredentials(username, passwordBuffer);
} }
/// <summary>
/// Adds the credentials to the MQTT client options.
/// </summary>
/// <param name="username">The user name.</param>
/// <param name="password">The password.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithCredentials(string username, byte[] password = null) public MqttClientOptionsBuilder WithCredentials(string username, byte[] password = null)
{ {
_options.Credentials = new MqttClientCredentials _options.Credentials = new MqttClientCredentials
@@ -257,11 +155,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds the credentials to the MQTT client options.
/// </summary>
/// <param name="credentials">The credentials.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithCredentials(IMqttClientCredentials credentials) public MqttClientOptionsBuilder WithCredentials(IMqttClientCredentials credentials)
{ {
_options.Credentials = credentials; _options.Credentials = credentials;
@@ -269,23 +162,12 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds a extended authentication exchange handler to the MQTT client options.
/// </summary>
/// <param name="handler">The handler.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithExtendedAuthenticationExchangeHandler(IMqttExtendedAuthenticationExchangeHandler handler) public MqttClientOptionsBuilder WithExtendedAuthenticationExchangeHandler(IMqttExtendedAuthenticationExchangeHandler handler)
{ {
_options.ExtendedAuthenticationExchangeHandler = handler; _options.ExtendedAuthenticationExchangeHandler = handler;
return this; return this;
} }
/// <summary>
/// Adds a TCP server connection to the MQTT client options.
/// </summary>
/// <param name="server">The server.</param>
/// <param name="port">The port.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithTcpServer(string server, int? port = null) public MqttClientOptionsBuilder WithTcpServer(string server, int? port = null)
{ {
_tcpOptions = new MqttClientTcpOptions _tcpOptions = new MqttClientTcpOptions
@@ -297,11 +179,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds a TCP server connection to the MQTT client options.
/// </summary>
/// <param name="optionsBuilder">The options builder.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
// TODO: Consider creating _MqttClientTcpOptionsBuilder_ as overload. // TODO: Consider creating _MqttClientTcpOptionsBuilder_ as overload.
public MqttClientOptionsBuilder WithTcpServer(Action<MqttClientTcpOptions> optionsBuilder) public MqttClientOptionsBuilder WithTcpServer(Action<MqttClientTcpOptions> optionsBuilder)
{ {
@@ -313,16 +190,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds a proxy connection to the MQTT client options.
/// </summary>
/// <param name="address">The address.</param>
/// <param name="username">The user name.</param>
/// <param name="password">The password.</param>
/// <param name="domain">The domain.</param>
/// <param name="bypassOnLocal">The bypass on local flag.</param>
/// <param name="bypassList">The bypass list.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithProxy(string address, string username = null, string password = null, string domain = null, bool bypassOnLocal = false, string[] bypassList = null) public MqttClientOptionsBuilder WithProxy(string address, string username = null, string password = null, string domain = null, bool bypassOnLocal = false, string[] bypassList = null)
{ {
_proxyOptions = new MqttClientWebSocketProxyOptions _proxyOptions = new MqttClientWebSocketProxyOptions
@@ -338,11 +205,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds a proxy connection to the MQTT client options.
/// </summary>
/// <param name="optionsBuilder">The options builder.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithProxy(Action<MqttClientWebSocketProxyOptions> optionsBuilder) public MqttClientOptionsBuilder WithProxy(Action<MqttClientWebSocketProxyOptions> optionsBuilder)
{ {
if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder)); if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder));
@@ -352,12 +214,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds a web socket server to the MQTT client options.
/// </summary>
/// <param name="uri">The uri.</param>
/// <param name="parameters">The parameters.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithWebSocketServer(string uri, MqttClientOptionsBuilderWebSocketParameters parameters = null) public MqttClientOptionsBuilder WithWebSocketServer(string uri, MqttClientOptionsBuilderWebSocketParameters parameters = null)
{ {
_webSocketOptions = new MqttClientWebSocketOptions _webSocketOptions = new MqttClientWebSocketOptions
@@ -370,11 +226,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds a web socket server to the MQTT client options.
/// </summary>
/// <param name="optionsBuilder">The options builder.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithWebSocketServer(Action<MqttClientWebSocketOptions> optionsBuilder) public MqttClientOptionsBuilder WithWebSocketServer(Action<MqttClientWebSocketOptions> optionsBuilder)
{ {
if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder)); if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder));
@@ -385,31 +236,17 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Adds TLS to the MQTT client options.
/// </summary>
/// <param name="parameters">The parameters.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithTls(MqttClientOptionsBuilderTlsParameters parameters) public MqttClientOptionsBuilder WithTls(MqttClientOptionsBuilderTlsParameters parameters)
{ {
_tlsParameters = parameters; _tlsParameters = parameters;
return this; return this;
} }
/// <summary>
/// Adds TLS to the MQTT client options.
/// </summary>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithTls() public MqttClientOptionsBuilder WithTls()
{ {
return WithTls(new MqttClientOptionsBuilderTlsParameters { UseTls = true }); return WithTls(new MqttClientOptionsBuilderTlsParameters { UseTls = true });
} }
/// <summary>
/// Adds TLS to the MQTT client options.
/// </summary>
/// <param name="optionsBuilder">The options builder.</param>
/// <returns>A new instance of the <see cref="MqttClientOptionsBuilder"/> class.</returns>
public MqttClientOptionsBuilder WithTls(Action<MqttClientOptionsBuilderTlsParameters> optionsBuilder) public MqttClientOptionsBuilder WithTls(Action<MqttClientOptionsBuilderTlsParameters> optionsBuilder)
{ {
if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder)); if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder));
@@ -419,10 +256,6 @@ namespace MQTTnet.Client.Options
return this; return this;
} }
/// <summary>
/// Builds the MQTT client options.
/// </summary>
/// <returns>The <see cref="IMqttClientOptions"/>.</returns>
public IMqttClientOptions Build() public IMqttClientOptions Build()
{ {
if (_tcpOptions == null && _webSocketOptions == null) if (_tcpOptions == null && _webSocketOptions == null)
@@ -6,9 +6,6 @@ namespace MQTTnet.Client.Publishing
{ {
public class MqttClientPublishResult public class MqttClientPublishResult
{ {
/// <summary>
/// Gets or sets the packet identifier.
/// </summary>
public ushort? PacketIdentifier { get; set; } public ushort? PacketIdentifier { get; set; }
/// <summary> /// <summary>
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.Receiving
{ {
public interface IMqttApplicationMessageReceivedHandler public interface IMqttApplicationMessageReceivedHandler
{ {
/// <summary>
/// Handles the application message received event.
/// </summary>
/// <param name="eventArgs">The event args.</param>
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
Task HandleApplicationMessageReceivedAsync(MqttApplicationMessageReceivedEventArgs eventArgs); Task HandleApplicationMessageReceivedAsync(MqttApplicationMessageReceivedEventArgs eventArgs);
} }
} }
@@ -31,26 +31,12 @@ namespace MQTTnet.Client.Subscribing
return this; return this;
} }
/// <summary>
/// Adds the subscription identifier to the subscribe options.
/// </summary>
/// <param name="subscriptionIdentifier">The subscription identifier.</param>
/// <returns>A new instance of the <see cref="MqttApplicationMessageBuilder"/> class.</returns>
public MqttClientSubscribeOptionsBuilder WithSubscriptionIdentifier(uint? subscriptionIdentifier) public MqttClientSubscribeOptionsBuilder WithSubscriptionIdentifier(uint? subscriptionIdentifier)
{ {
_subscribeOptions.SubscriptionIdentifier = subscriptionIdentifier; _subscribeOptions.SubscriptionIdentifier = subscriptionIdentifier;
return this; return this;
} }
/// <summary>
/// Adds a topic filter to the subscribe options.
/// </summary>
/// <param name="topic">The topic.</param>
/// <param name="qualityOfServiceLevel">The quality of service level.</param>
/// <param name="noLocal">A value indicating whether to not send messages originating on this client (noLocal) or not.</param>
/// <param name="retainAsPublished">A value indicating whether messages are retained as published or not.</param>
/// <param name="retainHandling">The retain handling.</param>
/// <returns>A new instance of the <see cref="MqttApplicationMessageBuilder"/> class.</returns>
public MqttClientSubscribeOptionsBuilder WithTopicFilter( public MqttClientSubscribeOptionsBuilder WithTopicFilter(
string topic, string topic,
MqttQualityOfServiceLevel qualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce, MqttQualityOfServiceLevel qualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce,
@@ -68,11 +54,6 @@ namespace MQTTnet.Client.Subscribing
}); });
} }
/// <summary>
/// Adds the topic filter to the subscribe options.
/// </summary>
/// <param name="topicFilterBuilder">The topic filter builder.</param>
/// <returns>A new instance of the <see cref="MqttApplicationMessageBuilder"/> class.</returns>
public MqttClientSubscribeOptionsBuilder WithTopicFilter(Action<MqttTopicFilterBuilder> topicFilterBuilder) public MqttClientSubscribeOptionsBuilder WithTopicFilter(Action<MqttTopicFilterBuilder> topicFilterBuilder)
{ {
if (topicFilterBuilder == null) throw new ArgumentNullException(nameof(topicFilterBuilder)); if (topicFilterBuilder == null) throw new ArgumentNullException(nameof(topicFilterBuilder));
@@ -83,11 +64,6 @@ namespace MQTTnet.Client.Subscribing
return WithTopicFilter(internalTopicFilterBuilder); return WithTopicFilter(internalTopicFilterBuilder);
} }
/// <summary>
/// Adds the topic filter to the subscribe options.
/// </summary>
/// <param name="topicFilterBuilder">The topic filter builder.</param>
/// <returns>A new instance of the <see cref="MqttApplicationMessageBuilder"/> class.</returns>
public MqttClientSubscribeOptionsBuilder WithTopicFilter(MqttTopicFilterBuilder topicFilterBuilder) public MqttClientSubscribeOptionsBuilder WithTopicFilter(MqttTopicFilterBuilder topicFilterBuilder)
{ {
if (topicFilterBuilder == null) throw new ArgumentNullException(nameof(topicFilterBuilder)); if (topicFilterBuilder == null) throw new ArgumentNullException(nameof(topicFilterBuilder));
@@ -95,11 +71,6 @@ namespace MQTTnet.Client.Subscribing
return WithTopicFilter(topicFilterBuilder.Build()); return WithTopicFilter(topicFilterBuilder.Build());
} }
/// <summary>
/// Adds the topic filter to the subscribe options.
/// </summary>
/// <param name="topicFilter">The topic filter.</param>
/// <returns>A new instance of the <see cref="MqttApplicationMessageBuilder"/> class.</returns>
public MqttClientSubscribeOptionsBuilder WithTopicFilter(MqttTopicFilter topicFilter) public MqttClientSubscribeOptionsBuilder WithTopicFilter(MqttTopicFilter topicFilter)
{ {
if (topicFilter == null) throw new ArgumentNullException(nameof(topicFilter)); if (topicFilter == null) throw new ArgumentNullException(nameof(topicFilter));
@@ -114,10 +85,6 @@ namespace MQTTnet.Client.Subscribing
return this; return this;
} }
/// <summary>
/// Builds the subscription options.
/// </summary>
/// <returns>A new instance of the <see cref="MqttClientSubscribeOptions"/> class.</returns>
public MqttClientSubscribeOptions Build() public MqttClientSubscribeOptions Build()
{ {
return _subscribeOptions; return _subscribeOptions;
@@ -43,11 +43,6 @@ namespace MQTTnet.Client.Unsubscribing
return this; return this;
} }
/// <summary>
/// Adds the topic filter to the unsubscribe options.
/// </summary>
/// <param name="topic">The topic.</param>
/// <returns>A new instance of the <see cref="MqttClientUnsubscribeOptionsBuilder"/> class.</returns>
public MqttClientUnsubscribeOptionsBuilder WithTopicFilter(string topic) public MqttClientUnsubscribeOptionsBuilder WithTopicFilter(string topic)
{ {
if (topic is null) throw new ArgumentNullException(nameof(topic)); if (topic is null) throw new ArgumentNullException(nameof(topic));
@@ -62,11 +57,6 @@ namespace MQTTnet.Client.Unsubscribing
return this; return this;
} }
/// <summary>
/// Adds the topic filter to the unsubscribe options.
/// </summary>
/// <param name="topicFilter">The topic filter.</param>
/// <returns>A new instance of the <see cref="MqttClientUnsubscribeOptionsBuilder"/> class.</returns>
public MqttClientUnsubscribeOptionsBuilder WithTopicFilter(MqttTopicFilter topicFilter) public MqttClientUnsubscribeOptionsBuilder WithTopicFilter(MqttTopicFilter topicFilter)
{ {
if (topicFilter is null) throw new ArgumentNullException(nameof(topicFilter)); if (topicFilter is null) throw new ArgumentNullException(nameof(topicFilter));
@@ -74,10 +64,6 @@ namespace MQTTnet.Client.Unsubscribing
return WithTopicFilter(topicFilter.Topic); return WithTopicFilter(topicFilter.Topic);
} }
/// <summary>
/// Builds the unsubscription options.
/// </summary>
/// <returns>A new instance of the <see cref="MqttClientUnsubscribeOptions"/> class.</returns>
public MqttClientUnsubscribeOptions Build() public MqttClientUnsubscribeOptions Build()
{ {
return _unsubscribeOptions; return _unsubscribeOptions;