mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 10:26:11 +08:00
Move events to server level instead of options.
This commit is contained in:
@@ -11,19 +11,20 @@ namespace MQTTnet.Benchmarks
|
||||
[MemoryDiagnoser]
|
||||
public class MessageProcessingBenchmark
|
||||
{
|
||||
IMqttServer _mqttServer;
|
||||
MqttServer _mqttServer;
|
||||
IMqttClient _mqttClient;
|
||||
MqttApplicationMessage _message;
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup()
|
||||
{
|
||||
var serverOptions = new MqttServerOptionsBuilder().Build();
|
||||
|
||||
var factory = new MqttFactory();
|
||||
_mqttServer = factory.CreateMqttServer();
|
||||
_mqttServer = factory.CreateMqttServer(serverOptions);
|
||||
_mqttClient = factory.CreateMqttClient();
|
||||
|
||||
var serverOptions = new MqttServerOptionsBuilder().Build();
|
||||
_mqttServer.StartAsync(serverOptions).GetAwaiter().GetResult();
|
||||
_mqttServer.StartAsync().GetAwaiter().GetResult();
|
||||
|
||||
var clientOptions = new MqttClientOptionsBuilder()
|
||||
.WithTcpServer("localhost").Build();
|
||||
|
||||
Reference in New Issue
Block a user