Exemple #1
0
 /// <summary>
 /// Stop one twin
 /// </summary>
 /// <param name="id"></param>
 /// <param name="twin"></param>
 /// <returns></returns>
 private async Task StopOneTwinAsync(string id, TwinHost twin)
 {
     _logger.Debug("{id} twin is stopping...", id);
     try {
         // Stop host async
         await twin.StopAsync();
     }
     catch (Exception ex) {
         // BUGBUG: IoT Hub client SDK throws general exceptions independent
         // of what actually happened.  Instead of parsing the message,
         // just continue.
         _logger.Debug(ex,
                       "{id} twin stopping raised exception, continue...", id);
     }
     finally {
         twin.Dispose();
     }
     _logger.Information("{id} twin stopped.", id);
 }