mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Add new samples.
This commit is contained in:
+9
-3
@@ -39,10 +39,16 @@ Console.WriteLine();
|
||||
|
||||
try
|
||||
{
|
||||
var task = selectedSampleMethod.Invoke(null, null) as Task;
|
||||
task?.Wait();
|
||||
if (selectedSampleMethod.Invoke(null, null) is Task task)
|
||||
{
|
||||
await task;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Console.WriteLine(exception.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press Enter to exit.");
|
||||
Console.ReadLine();
|
||||
Reference in New Issue
Block a user