Azure/DotNetty

Azure DeviceClient - never shutting down poll tasks

PaintedGauthier opened this issue · 0 comments

https://stackoverflow.com/questions/69485035/azure-deviceclient-does-not-shut-down-dotnetty-threads-on-program-exit
Many more details above,

With this code snippet in my project, is_running gets set to false when the app exits.
This will leave 8 PollTasks open

All i have is _deviceClient, and no good way to shut DotNetty stuff off.
Im assuming the below code should handle that?

Ill check back periodically to see if more info is needed, or I should be posting elsewhere

using (var _deviceClient = DeviceClient.CreateFromConnectionString(connection_string, TransportType.Mqtt)) { await _deviceClient.OpenAsync(); while (is_running) Thread.Sleep(500); await _deviceClient.CloseAsync(); }