Bläddra i källkod

Restore console log of test app

release/3.x.x
Christian Kratky 7 år sedan
förälder
incheckning
f85721fbf5
2 ändrade filer med 9 tillägg och 8 borttagningar
  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 Visa fil

@@ -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 Visa fil

@@ -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.");


Laddar…
Avbryt
Spara