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
{
/// <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);
}
}
@@ -13,24 +13,12 @@ namespace MQTTnet.Client.Connecting
/// </summary>
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; }
/// <summary>
/// Gets or sets a value indicating whether wildcard subscriptions are available.
/// </summary>
public bool? WildcardSubscriptionAvailable { get; set; }
/// <summary>
/// Gets or sets a value indicating whether retained messages are available.
/// </summary>
public bool? RetainAvailable { get; set; }
/// <summary>
/// Gets or sets the assigned client identifier.
/// </summary>
public string AssignedClientIdentifier { get; set; }
/// <summary>
@@ -45,9 +33,6 @@ namespace MQTTnet.Client.Connecting
/// </summary>
public byte[] AuthenticationData { get; set; }
/// <summary>
/// Gets or sets the maximum packet size.
/// </summary>
public uint? MaximumPacketSize { get; set; }
/// <summary>
@@ -56,14 +41,8 @@ namespace MQTTnet.Client.Connecting
/// </summary>
public string ReasonString { get; set; }
/// <summary>
/// Gets or sets the receive maximum.
/// </summary>
public ushort? ReceiveMaximum { get; set; }
/// <summary>
/// Gets or sets the maximum quality od service level.
/// </summary>
public MqttQualityOfServiceLevel MaximumQoS { get; set; }
/// <summary>
@@ -72,24 +51,12 @@ namespace MQTTnet.Client.Connecting
/// </summary>
public string ResponseInformation { get; set; }
/// <summary>
/// Gets or sets the topic alias maximum.
/// </summary>
public ushort? TopicAliasMaximum { get; set; }
/// <summary>
/// Gets or sets the server reference.
/// </summary>
public string ServerReference { get; set; }
/// <summary>
/// Gets or sets the server keep alive.
/// </summary>
public ushort? ServerKeepAlive { get; set; }
/// <summary>
/// Gets or sets the session expiry interval.
/// </summary>
public uint? SessionExpiryInterval { get; set; }
/// <summary>
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.Disconnecting
{
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);
}
}
@@ -15,14 +15,8 @@ namespace MQTTnet.Client.Disconnecting
ReasonCode = reason;
}
/// <summary>
/// Gets a value indicating whether the client was connected or not.
/// </summary>
public bool ClientWasConnected { get; }
/// <summary>
/// Gets the exception.
/// </summary>
public Exception Exception { get; }
/// <summary>
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.ExtendedAuthenticationExchange
{
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);
}
}
@@ -53,9 +53,6 @@ namespace MQTTnet.Client.ExtendedAuthenticationExchange
/// </summary>
public List<MqttUserProperty> UserProperties { get; }
/// <summary>
/// Gets the client.
/// </summary>
public IMqttClient Client { get; }
}
}
-32
View File
@@ -12,9 +12,6 @@ namespace MQTTnet.Client
{
public interface IMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable
{
/// <summary>
/// Gets a value indicating whether the client is connected or not.
/// </summary>
bool IsConnected { get; }
/// <summary>
@@ -35,27 +32,10 @@ namespace MQTTnet.Client
/// </summary>
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);
/// <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);
/// <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);
/// <summary>
@@ -67,20 +47,8 @@ namespace MQTTnet.Client
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
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);
/// <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);
}
}
@@ -6,67 +6,22 @@ namespace MQTTnet.Client
{
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);
/// <summary>
/// Creates a new low level MQTT client.
/// </summary>
/// <returns>A new <see cref="ILowLevelMqttClient"/>.</returns>
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);
/// <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);
/// <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);
/// <summary>
/// Creates a new MQTT client.
/// </summary>
/// <returns>A new <see cref="IMqttClient"/>.</returns>
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);
/// <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);
/// <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);
}
}
@@ -24,29 +24,14 @@ namespace MQTTnet.Client.Options
/// </summary>
bool CleanSession { get; }
/// <summary>
/// Gets the credentials.
/// </summary>
IMqttClientCredentials Credentials { get; }
/// <summary>
/// Gets the extended authentication exchange handler.
/// </summary>
IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; }
/// <summary>
/// Gets the protocol version.
/// </summary>
MqttProtocolVersion ProtocolVersion { get; }
/// <summary>
/// Gets the channel options.
/// </summary>
IMqttClientChannelOptions ChannelOptions { get; }
/// <summary>
/// Gets the timeout the communication uses.
/// </summary>
TimeSpan CommunicationTimeout { get; }
/// <summary>
@@ -82,9 +67,6 @@ namespace MQTTnet.Client.Options
/// </summary>
byte[] AuthenticationData { get; }
/// <summary>
/// Gets the maximum packet size.
/// </summary>
uint? MaximumPacketSize { get; }
/// <summary>
@@ -5,24 +5,12 @@ namespace MQTTnet.Client.Options
{
public class MqttClientCertificateValidationCallbackContext
{
/// <summary>
/// Gets or sets the certificate.
/// </summary>
public X509Certificate Certificate { get; set; }
/// <summary>
/// Gets or sets the certificate chain.
/// </summary>
public X509Chain Chain { get; set; }
/// <summary>
/// Gets or sets the SSL policy errors.
/// </summary>
public SslPolicyErrors SslPolicyErrors { get; set; }
/// <summary>
/// Gets or sets the client options.
/// </summary>
public IMqttClientChannelOptions ClientOptions { get; set; }
}
}
@@ -24,29 +24,14 @@ namespace MQTTnet.Client.Options
/// </summary>
public bool CleanSession { get; set; } = true;
/// <summary>
/// Gets or sets the credentials.
/// </summary>
public IMqttClientCredentials Credentials { get; set; }
/// <summary>
/// Gets or sets the extended authentication exchange handler.
/// </summary>
public IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; set; }
/// <summary>
/// Gets or sets the protocol version.
/// </summary>
public MqttProtocolVersion ProtocolVersion { get; set; } = MqttProtocolVersion.V311;
/// <summary>
/// Gets or sets the channel options.
/// </summary>
public IMqttClientChannelOptions ChannelOptions { get; set; }
/// <summary>
/// Gets or sets the timeout the communication uses.
/// </summary>
public TimeSpan CommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10);
/// <summary>
@@ -82,9 +67,6 @@ namespace MQTTnet.Client.Options
/// </summary>
public byte[] AuthenticationData { get; set; }
/// <summary>
/// Gets or sets the maximum packet size.
/// </summary>
public uint? MaximumPacketSize { get; set; }
/// <summary>
@@ -17,11 +17,6 @@ namespace MQTTnet.Client.Options
MqttClientOptionsBuilderTlsParameters _tlsParameters;
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)
{
if (value == MqttProtocolVersion.Unknown)
@@ -33,88 +28,47 @@ namespace MQTTnet.Client.Options
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)
{
_options.CommunicationTimeout = value;
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)
{
_options.CleanSession = value;
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.")]
public MqttClientOptionsBuilder WithKeepAliveSendInterval(TimeSpan value)
{
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()
{
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)
{
_options.KeepAlivePeriod = value;
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)
{
_options.ClientId = value;
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)
{
_options.WillMessage = value;
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)
{
_options.AuthenticationMethod = method;
@@ -122,92 +76,48 @@ namespace MQTTnet.Client.Options
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)
{
_options.WillDelayInterval = willDelayInterval;
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)
{
_options.TopicAliasMaximum = topicAliasMaximum;
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)
{
_options.MaximumPacketSize = maximumPacketSize;
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)
{
_options.ReceiveMaximum = receiveMaximum;
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)
{
_options.RequestProblemInformation = requestProblemInformation;
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)
{
_options.RequestResponseInformation = requestResponseInformation;
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)
{
_options.SessionExpiryInterval = sessionExpiryInterval;
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)
{
if (name is null) throw new ArgumentNullException(nameof(name));
@@ -222,12 +132,6 @@ namespace MQTTnet.Client.Options
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)
{
byte[] passwordBuffer = null;
@@ -240,12 +144,6 @@ namespace MQTTnet.Client.Options
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)
{
_options.Credentials = new MqttClientCredentials
@@ -257,11 +155,6 @@ namespace MQTTnet.Client.Options
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)
{
_options.Credentials = credentials;
@@ -269,23 +162,12 @@ namespace MQTTnet.Client.Options
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)
{
_options.ExtendedAuthenticationExchangeHandler = handler;
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)
{
_tcpOptions = new MqttClientTcpOptions
@@ -297,11 +179,6 @@ namespace MQTTnet.Client.Options
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.
public MqttClientOptionsBuilder WithTcpServer(Action<MqttClientTcpOptions> optionsBuilder)
{
@@ -313,16 +190,6 @@ namespace MQTTnet.Client.Options
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)
{
_proxyOptions = new MqttClientWebSocketProxyOptions
@@ -338,11 +205,6 @@ namespace MQTTnet.Client.Options
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)
{
if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder));
@@ -352,12 +214,6 @@ namespace MQTTnet.Client.Options
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)
{
_webSocketOptions = new MqttClientWebSocketOptions
@@ -370,11 +226,6 @@ namespace MQTTnet.Client.Options
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)
{
if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder));
@@ -385,31 +236,17 @@ namespace MQTTnet.Client.Options
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)
{
_tlsParameters = parameters;
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()
{
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)
{
if (optionsBuilder == null) throw new ArgumentNullException(nameof(optionsBuilder));
@@ -419,10 +256,6 @@ namespace MQTTnet.Client.Options
return this;
}
/// <summary>
/// Builds the MQTT client options.
/// </summary>
/// <returns>The <see cref="IMqttClientOptions"/>.</returns>
public IMqttClientOptions Build()
{
if (_tcpOptions == null && _webSocketOptions == null)
@@ -6,9 +6,6 @@ namespace MQTTnet.Client.Publishing
{
public class MqttClientPublishResult
{
/// <summary>
/// Gets or sets the packet identifier.
/// </summary>
public ushort? PacketIdentifier { get; set; }
/// <summary>
@@ -4,11 +4,6 @@ namespace MQTTnet.Client.Receiving
{
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);
}
}
@@ -31,26 +31,12 @@ namespace MQTTnet.Client.Subscribing
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)
{
_subscribeOptions.SubscriptionIdentifier = subscriptionIdentifier;
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(
string topic,
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)
{
if (topicFilterBuilder == null) throw new ArgumentNullException(nameof(topicFilterBuilder));
@@ -83,11 +64,6 @@ namespace MQTTnet.Client.Subscribing
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)
{
if (topicFilterBuilder == null) throw new ArgumentNullException(nameof(topicFilterBuilder));
@@ -95,11 +71,6 @@ namespace MQTTnet.Client.Subscribing
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)
{
if (topicFilter == null) throw new ArgumentNullException(nameof(topicFilter));
@@ -114,10 +85,6 @@ namespace MQTTnet.Client.Subscribing
return this;
}
/// <summary>
/// Builds the subscription options.
/// </summary>
/// <returns>A new instance of the <see cref="MqttClientSubscribeOptions"/> class.</returns>
public MqttClientSubscribeOptions Build()
{
return _subscribeOptions;
@@ -43,11 +43,6 @@ namespace MQTTnet.Client.Unsubscribing
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)
{
if (topic is null) throw new ArgumentNullException(nameof(topic));
@@ -62,11 +57,6 @@ namespace MQTTnet.Client.Unsubscribing
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)
{
if (topicFilter is null) throw new ArgumentNullException(nameof(topicFilter));
@@ -74,10 +64,6 @@ namespace MQTTnet.Client.Unsubscribing
return WithTopicFilter(topicFilter.Topic);
}
/// <summary>
/// Builds the unsubscription options.
/// </summary>
/// <returns>A new instance of the <see cref="MqttClientUnsubscribeOptions"/> class.</returns>
public MqttClientUnsubscribeOptions Build()
{
return _unsubscribeOptions;