mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-21 12:16:02 +08:00
fixed unittests and addressed todo
This commit is contained in:
@@ -4,6 +4,7 @@ using MQTTnet.Core.Client;
|
||||
using MQTTnet.Core.Serializer;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MQTTnet.Implementations;
|
||||
using MQTTnet.Core.ManagedClient;
|
||||
using MQTTnet.Core.Server;
|
||||
@@ -109,5 +110,14 @@ namespace MQTTnet
|
||||
{
|
||||
return _serviceProvider.GetRequiredService<IMqttServer>();
|
||||
}
|
||||
|
||||
public IMqttServer CreateMqttServer(Action<MqttServerOptions> configure)
|
||||
{
|
||||
var options = _serviceProvider.GetRequiredService<IOptions<MqttServerOptions>>();
|
||||
|
||||
configure(options.Value);
|
||||
|
||||
return _serviceProvider.GetRequiredService<IMqttServer>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user