Feature/mqttv5 subscriptions server (#1246)

* Add support for RetainHandling.

* Add support for No Local.

* Add support for _SubscriptionIdentifier_.

* Add more Unit Tests.

* Update docs.
This commit is contained in:
Christian
2021-09-23 20:30:43 +02:00
committed by GitHub
parent feb53e78c6
commit c756a4092f
83 changed files with 2032 additions and 1237 deletions
+24 -3
View File
@@ -27,9 +27,9 @@ namespace MQTTnet
/// The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator).
/// </summary>
string _topic;
bool? _noLocal;
bool? _retainAsPublished;
MqttRetainHandling? _retainHandling;
bool _noLocal;
bool _retainAsPublished;
MqttRetainHandling _retainHandling = MqttRetainHandling.SendAtSubscribe;
public MqttTopicFilterBuilder WithTopic(string topic)
{
@@ -61,19 +61,40 @@ namespace MQTTnet
return this;
}
[Obsolete("Please use overload with _bool_ instead.")]
public MqttTopicFilterBuilder WithNoLocal(bool? value = true)
{
_noLocal = value == true;
return this;
}
public MqttTopicFilterBuilder WithNoLocal(bool value = true)
{
_noLocal = value;
return this;
}
[Obsolete("Please use overload with _bool_ instead.")]
public MqttTopicFilterBuilder WithRetainAsPublished(bool? value = true)
{
_retainAsPublished = value == true;
return this;
}
public MqttTopicFilterBuilder WithRetainAsPublished(bool value = true)
{
_retainAsPublished = value;
return this;
}
[Obsolete("Please use overload with _MqttRetainHandling_ instead.")]
public MqttTopicFilterBuilder WithRetainHandling(MqttRetainHandling? value)
{
_retainHandling = value ?? MqttRetainHandling.SendAtSubscribe;
return this;
}
public MqttTopicFilterBuilder WithRetainHandling(MqttRetainHandling value)
{
_retainHandling = value;
return this;