Help with using v4.3.3.952 managed client #1985
Unanswered
PNPTransistor
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I'm using the ManagedClient simple example given on this site. I'm connecting to my free HIVE account and all is well.
However, in your example, you write this:
Console.WriteLine("The managed MQTT client is connected.");
... even if the client isn't connected. Seems a bit strange you'd write this without checking if the client is actually connected.
On the subject of IsConnected(), what is the criteria for this to be true?
It is false, up until the next line:
SpinWait.SpinUntil(() => managedMqttClient.PendingApplicationMessagesCount == 0, 10000);
After which it is true.
I don't understand why IsConnected() isn't true directly after the Client.StartAsync() method?
What I want is to click a [Connect] button, and instantly know whether the connection has been successful. I can't see how to instantly test the connection status??
Thanks
Regards.
Beta Was this translation helpful? Give feedback.
All reactions