Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDetecting timeout between device and server
https://www.eclipse.org/forums/index.php/mv/msg/1074234/1721525/#msg_1721525
I understand that the library makes no attempt to automatically reconnect, however calling client.reconnect() inside connectionLost() does not seem to be enough to guarentee that connection is restablished in all scenarios.
There are scenarios where either connectionLost is not called or client.reconnect has no effect (its hard to debug because I have to be moving about a lot during the day to detect these issues).
Regaining connection in all scenarios is core functionality for my application, if anyone has any ideas or suggestions, I would appreciate it. Thanks!]]>Edward Woodhouse2016-01-28T00:08:02-00:00Re: Detecting timeout between device and server
https://www.eclipse.org/forums/index.php/mv/msg/1074234/1721565/#msg_1721565
connectionLost() *should* catch any situation in which the connection is lost, I'm guessing this is the Java client? If there are any scenarios where it's not being called that would be good to get some debug information about. You could try turning on Trace in your application which may help us figure out what's going on under the covers: https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client]]>James Sutton2016-01-28T10:48:27-00:00Re: Detecting timeout between device and server
https://www.eclipse.org/forums/index.php/mv/msg/1074234/1721844/#msg_1721844
Edward Woodhouse2016-02-01T02:16:51-00:00Re: Detecting timeout between device and server
https://www.eclipse.org/forums/index.php/mv/msg/1074234/1723130/#msg_1723130
Edward Woodhouse2016-02-11T22:54:48-00:00Re: Detecting timeout between device and server
https://www.eclipse.org/forums/index.php/mv/msg/1074234/1724189/#msg_1724189
The Android service is a wrapper around the Java client which has some extra functionality that allows the app to reconnect if there was a change in network connection (E.g. Phone signal was lost then found). It also has some modified ping functionality that is better suited to android so that it does not drain the battery. I'm currently adding in full automatic reconnect & offline buffering into the core Java library this month which will mean that upon connection loss, the client will continually attempt to re-acquire the connection.
Setting Keepalive to 0 simply turns off the keep alive functionality. This can be good or bad depending on how you look at it: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd02/mqtt-v3.1.1-csprd02.html#_Toc385349238
Effectively if the connection is lost, neither client or server will know until they attempt to send a message. This means that if your client was subscribed to one or more topics and the connection was lost, it would not receive any messages until it attempted to publish at which point it would discover the connection to be lost, would throw an error and would close the socket.]]>James Sutton2016-02-22T09:21:09-00:00Re: Detecting timeout between device and server
https://www.eclipse.org/forums/index.php/mv/msg/1074234/1724284/#msg_1724284
Edward Woodhouse2016-02-22T19:14:36-00:00