azure-iot-sdk-csharp | connecting devices to Microsoft Azure IoT services | Azure library
kandi X-RAY | azure-iot-sdk-csharp Summary
kandi X-RAY | azure-iot-sdk-csharp Summary
A C# SDK for connecting devices to Microsoft Azure IoT services
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of azure-iot-sdk-csharp
azure-iot-sdk-csharp Key Features
azure-iot-sdk-csharp Examples and Code Snippets
Community Discussions
Trending Discussions on azure-iot-sdk-csharp
QUESTION
When using Microsoft.Azure.Devices.Client.DeviceClient .net framework 4.8 closing out the application leaves multiple Threads running. Specifically DotNetty.Common.dll! DotNetty.Common.Concurrency.SingleThreadEventExecutor.PollTask
Versions 1.34.0 & 1.35.0 of Microsoft.Azure.Devices have this same problem. Are we using DeviceClient improperly? Is it a async thing im not understanding? Am i missing a call to shut it down properly?
From examples online, i shouldn't have to do anything special and it should close it self out. However it still hangs, currently this is a close implementation. I have yet to make a stand alone, so i havent duplicated this problem with only DeviceClient Code running
When the program exits, is_running gets set, and the program closes down other threads. Eventually we call Environment.Exit(0);
This should be all the relevant code
...ANSWER
Answered 2022-Jan-25 at 22:08https://github.com/Azure/azure-sdk-for-net/issues/24550 https://github.com/Azure/azure-iot-sdk-csharp/issues/2194
Not a configuration issue, a 'dot netty' bug was hanging. The fix, get a newer azure version Microsoft.Azure.Devices > 1.35.0
QUESTION
Describe the bug
DeviceClient SetMethodDefaultHandlerAsync handler is not triggered on internet disconnection instantly. It triggers after 15 to 20 minutes. Below are the logs
IoT Hub connection status Changed Status: Connected Reason: Connection_Ok Time: 3:09:15 PM +02 IoT Hub connection status Changed Status: Disconnected_Retrying Reason: Communication_Error Time: 3:26:29 PM +02
I disconnected the internet at 3:10:00 PM +02 and communication error was thrown after 16 minutes. I have created a sample code which reproduces the issue
Steps to reproduce
...ANSWER
Answered 2020-Aug-31 at 08:08As per the outcome of discussion in github: https://github.com/Azure/azure-iot-sdk-csharp/issues/1409
The SDK is relying on the OS TCP stack to inform that the disconnect has happened, and the OS can take a couple of retries before relaying this information. This might be what is causing the connection status change handler to get invoked with a 15min delay on Linux.
For Mqtt, the client does send a ping request every 75 seconds, but does not seem to be monitoring the ping response being received from the broker.
PS: This is not occurring when using Windows 10 OS
Update
Added a fix for the mqtt layer, where the sdk now monitors for a ping response and disconnects if the delay between sending a ping request and receiving a response is >30secs (this value is currently not configurable).
For the amqp implementation, the amqp library encapsulates this ping request-response logic from us; all that the device sdk does is set the IdleTimeout.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-iot-sdk-csharp
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page