private void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            Task.WaitAll(_sendTasks.Select(t => t.AsTask()).ToArray());

            _tSource.Cancel();

            _listener.Wait();

            _instance = null;
        }
 public static IoTHubService Instance()
 {
     return(_instance ?? (_instance = new IoTHubService()));
 }