浏览代码

Restore console log of test app

release/3.x.x
Christian Kratky 7 年前
父节点
当前提交
f85721fbf5
共有 2 个文件被更改,包括 9 次插入8 次删除
  1. +7
    -7
      Tests/MQTTnet.TestApp.NetCore/ClientTest.cs
  2. +2
    -1
      Tests/MQTTnet.TestApp.NetCore/ServerTest.cs

+ 7
- 7
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();


+ 2
- 1
Tests/MQTTnet.TestApp.NetCore/ServerTest.cs 查看文件

@@ -49,6 +49,7 @@ namespace MQTTnet.TestApp.NetCore
});

var serviceProvider = services.BuildServiceProvider();
serviceProvider.GetRequiredService<ILoggerFactory>().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<IMqttServer>();
var mqttServer = new MqttFactory(serviceProvider).CreateMqttServer();
mqttServer.ClientDisconnected += (s, e) =>
{
Console.Write("Client disconnected event fired.");


正在加载...
取消
保存