How long it take for onSubAck callback to invoke incase of there is issue with the network or incase of any other issue #661
Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
-
I tired setting protocolOperationTimeoutMs to 10000 and tried calling Subscribe() multiple times when there is no internet connection, but as the return value of function (packet Id) is increases the time out also increases, when packet Id reaches to 20, function wait for more than 5 minutes. How the packet Id is related to a time out ? |
Beta Was this translation helpful? Give feedback.
-
The ack timeout is only for packets that have been sent and are waiting for a response. If there's no connection, nothing will be sent, and there will be no timeout. |
Beta Was this translation helpful? Give feedback.
-
I am using below function to subscribe to a topic, we need to pass a callback function to get callback for server acknowledgement.
Question 1:
The function declaration doesn't clarify how long one should wait to get callback, sometime it take more than 5 minutes (if internet connection is lost), we can't wait infinitely as there are chances that it can block the thread forever,
Question 2
Do we need to wait for call back if function return 0, there are chances of crash if local function address is passed to callback if the control is return from that function. Also when subscribe called on disconnected mqtt connection object, function return non-zero value but callback never get called.
Beta Was this translation helpful? Give feedback.
All reactions