public async Task MqttService() { await _mqttService.StartAsync(); int count = 1; do { await _mqttService.PublishAsync("hello", $"test message {count++}"); }while (Console.ReadKey().KeyChar != 'q'); //while (Console.KeyAvailable); }
public Task StartAsync(CancellationToken cancellationToken) { return(_mqttService.StartAsync()); }