Refactor manage client

This commit is contained in:
Christian Kratky
2017-10-21 15:49:50 +02:00
parent d052f409b6
commit 24c35de330
17 changed files with 485 additions and 108 deletions
+12 -7
View File
@@ -23,22 +23,27 @@ namespace MQTTnet.TestApp.NetCore
Console.WriteLine("1 = Start client");
Console.WriteLine("2 = Start server");
Console.WriteLine("3 = Start performance test");
Console.WriteLine("4 = Start managed client");
var pressedKey = Console.ReadKey(true);
if (pressedKey.Key == ConsoleKey.D1)
if (pressedKey.KeyChar == '1')
{
Task.Run(RunClientAsync);
Thread.Sleep(Timeout.Infinite);
}
else if (pressedKey.Key == ConsoleKey.D2)
else if (pressedKey.KeyChar == '2')
{
Task.Run(() => RunServerAsync());
Thread.Sleep(Timeout.Infinite);
Task.Run(RunServerAsync);
}
else if (pressedKey.Key == ConsoleKey.D3)
else if (pressedKey.KeyChar == '3')
{
Task.Run(PerformanceTest.RunAsync);
Thread.Sleep(Timeout.Infinite);
}
else if (pressedKey.KeyChar == '4')
{
Task.Run(ManagedClientTest.RunAsync);
}
Thread.Sleep(Timeout.Infinite);
}
private static async Task RunClientAsync()