I've recently started working with the Azure-Iot-SDK and wonder how to investigate this behaviour. My application is ok with sending messages to the IoT hub for some time, but suddenly just stops sending. Without an error or anything else that helps me find the rootcause for this. Just restarting the application (a service to be precise) is enough to get it working again.
Code is like this (on DataChangedEvent) :
try {
deviceClient = DeviceClient.Create(connectionString, x509Certificate, tType);
Log("Start sending message")
await deviceClient.SendEventAsync(message);
DoLogging("Done sending!");
}
catch (Exception e)
{
moreLogging("Error occurred");
}
Somehow the "Done sending!" message stops appearing in the logs, but the "Start sending message" keeps coming. Does anyone have any suggestions how to proceed?