I use the IoT Hub Java library to send messages between my devices and Microsoft Azure.
To connect I call
client = new DeviceClient(connString, protocol);
client.open();
And then, to send a message I call
client.sendEventAsync(message, callback, lockobj);
Then, my callback
function is called when the message is sent.
However, and here is the problem, after calling sendEventAsync
on my terminal appears infinitly the message Lost connection to the server. Reconnecting 0 time.
I've tried to close the connection after send the message and reopen it each time, but I think it's worst and the problem persists. Moreover, I've executed the test sample given by Azure (https://github.com/Azure-Samples/azure-iot-samples-java/archive/master.zip) and I have the same problem.
So my question is, is there a problem with the library (since the problem is present even with its code)? Or am I doing something wrong?
Thanks a lot!