Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Automatic reconnect and offline buffering implemented for JavaScript Client

Hi Mike,

that's great, thanks!  James and I will be taking a look at it soon.  Is there any progress on automated build and testing?  We're just starting to use Travis-CI for the Java and C clients.

Ian

On 05/26/2016 08:13 PM, Mike Tran wrote:
Hi all,
 
I have completed the development and manual testing of automatic reconnect and offline buffering for _javascript_ client.  You can see the summary of changes on github under this pull request
 
    (src/mqttws31.js)
 
To enable offline buffering, set  disconnectedPublishing = true.  Default offline buffer size is 5000, it can be set via disconnectedBufferSize property.  Here is an example:
 
      var client = new Paho.MQTT.Client(server, port, clientId);
        client._onConnected_ = onConnected;
        client._onConnectionLost_ = onConnectionLost;
        client._onMessageArrived_ = onMessageArrived;
        client._onMessageDelivered_ = onMessageDelivered;
        client.disconnectedPublishing = true;
        client.disconnectedBufferSize = 100;
 
To enable automatic reconnect, set reconnect option to true, e.g.:
 
       client.connect(
                {cleanSession : false,
                    onSuccess : onConnectSuccess,
                    onFailure : onFailedConnect,
                    keepAliveInterval : 10,
                    reconnect : true});
 
I have manually tested the code and I have not found any regression. I would appreciate additional testing and feedback.
 
--
Regards,
Mike Tran
 



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


Back to the top