diff --git a/Tests/MQTTnet.TestApp.NetCore/ClientTest.cs b/Tests/MQTTnet.TestApp.NetCore/ClientTest.cs index cccdff6..df3cd76 100644 --- a/Tests/MQTTnet.TestApp.NetCore/ClientTest.cs +++ b/Tests/MQTTnet.TestApp.NetCore/ClientTest.cs @@ -17,14 +17,14 @@ namespace MQTTnet.TestApp.NetCore { ClientId = "XYZ", CleanSession = true, - ////ChannelOptions = new MqttClientTcpOptions - ////{ - //// Server = "localhost" - ////}, - ChannelOptions = new MqttClientWebSocketOptions + ChannelOptions = new MqttClientTcpOptions { - Uri = "localhost" - } + Server = "localhost" + }, + ////ChannelOptions = new MqttClientWebSocketOptions + ////{ + //// Uri = "localhost" + ////} }; var factory = new MqttFactory(); diff --git a/Tests/MQTTnet.TestApp.NetCore/ServerTest.cs b/Tests/MQTTnet.TestApp.NetCore/ServerTest.cs index 0432a67..a0c6462 100644 --- a/Tests/MQTTnet.TestApp.NetCore/ServerTest.cs +++ b/Tests/MQTTnet.TestApp.NetCore/ServerTest.cs @@ -49,6 +49,7 @@ namespace MQTTnet.TestApp.NetCore }); var serviceProvider = services.BuildServiceProvider(); + serviceProvider.GetRequiredService().AddConsole(); //var certificate = new X509Certificate(@"C:\certs\test\test.cer", ""); //options.TlsEndpointOptions.Certificate = certificate.Export(X509ContentType.Cert); @@ -56,7 +57,7 @@ namespace MQTTnet.TestApp.NetCore //options.DefaultEndpointOptions.IsEnabled = true; //options.TlsEndpointOptions.IsEnabled = false; - var mqttServer = serviceProvider.GetRequiredService(); + var mqttServer = new MqttFactory(serviceProvider).CreateMqttServer(); mqttServer.ClientDisconnected += (s, e) => { Console.Write("Client disconnected event fired.");