|
|
@@ -1,4 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.Net; |
|
|
|
|
|
|
|
namespace MQTTnet.Server |
|
|
|
{ |
|
|
@@ -18,33 +19,45 @@ namespace MQTTnet.Server |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithDefaultEndpointPort(int value) |
|
|
|
public MqttServerOptionsBuilder WithDefaultEndpoint() |
|
|
|
{ |
|
|
|
_options.DefaultEndpointOptions.Port = value; |
|
|
|
_options.DefaultEndpointOptions.IsEnabled = true; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithDefaultEndpoint() |
|
|
|
public MqttServerOptionsBuilder WithDefaultEndpointPort(int? value) |
|
|
|
{ |
|
|
|
_options.DefaultEndpointOptions.IsEnabled = true; |
|
|
|
_options.DefaultEndpointOptions.Port = value; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithDefaultEndpointBoundIPAddress(IPAddress value) |
|
|
|
{ |
|
|
|
_options.DefaultEndpointOptions.BoundIPAddress = value ?? IPAddress.Any; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithoutDefaultEndpoint() |
|
|
|
{ |
|
|
|
_options.DefaultEndpointOptions.IsEnabled = false; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithEncryptedEndpoint() |
|
|
|
{ |
|
|
|
_options.TlsEndpointOptions.IsEnabled = true; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithoutEncryptedEndpoint() |
|
|
|
public MqttServerOptionsBuilder WithEncryptedEndpointPort(int? value) |
|
|
|
{ |
|
|
|
_options.TlsEndpointOptions.IsEnabled = false; |
|
|
|
_options.TlsEndpointOptions.Port = value; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithEncryptedEndpointBoundIPAddress(IPAddress value) |
|
|
|
{ |
|
|
|
_options.TlsEndpointOptions.BoundIPAddress = value; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
@@ -54,6 +67,12 @@ namespace MQTTnet.Server |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithoutEncryptedEndpoint() |
|
|
|
{ |
|
|
|
_options.TlsEndpointOptions.IsEnabled = false; |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
public MqttServerOptionsBuilder WithStorage(IMqttServerStorage value) |
|
|
|
{ |
|
|
|
_options.Storage = value; |
|
|
|