Skip to content

Commit

Permalink
Merge branch 'master' of github.com:adamvr/MQTT.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Nov 21, 2013
2 parents 42944be + a67bd37 commit 748b87e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ client.publish('messages', 'hello me!');
client.on('message', function(topic, message) {
console.log(message);
});
client.options.reconnectPeriod = 0; // disable automatic reconnect
```

### Chainable API!
Expand Down Expand Up @@ -158,3 +159,7 @@ mqtt.createServer(function(client) {
});
}).listen(1883);
```

## License

MIT
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ MqttClient.prototype._reconnect = function() {
MqttClient.prototype._setupReconnect = function() {
var that = this;

if (!that.disconnecting && !that.reconnectTimer) {
if (!that.disconnecting && !that.reconnectTimer && (that.options.reconnectPeriod > 0)) {
that.reconnectTimer = setInterval(function () {
that._reconnect();
}, that.options.reconnectPeriod);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Adam Rudd <adam.rudd@uqconnect.edu.au>",
"name": "mqtt",
"description": "A library for the MQTT protocol",
"version": "0.3.3",
"version": "0.3.4",
"contributors": [
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)"
],
Expand Down

0 comments on commit 748b87e

Please sign in to comment.