mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-21 04:03:05 +08:00
Update docs, fix managed client connection issue
This commit is contained in:
@@ -407,12 +407,14 @@ namespace MQTTnet.TestApp.UniversalWindows
|
||||
|
||||
{
|
||||
// Configure MQTT server.
|
||||
var optionsBuilder = new MqttServerOptionsBuilder()
|
||||
.WithConnectionBacklog(100)
|
||||
.WithDefaultEndpointPort(1884);
|
||||
|
||||
var options = new MqttServerOptions
|
||||
{
|
||||
ConnectionBacklog = 100
|
||||
};
|
||||
|
||||
options.DefaultEndpointOptions.Port = 1884;
|
||||
options.ConnectionValidator = c =>
|
||||
{
|
||||
if (c.ClientId != "Highlander")
|
||||
@@ -425,7 +427,7 @@ namespace MQTTnet.TestApp.UniversalWindows
|
||||
};
|
||||
|
||||
var mqttServer = new MqttFactory().CreateMqttServer();
|
||||
await mqttServer.StartAsync(options);
|
||||
await mqttServer.StartAsync(optionsBuilder.Build());
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user