Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #73 from mcollina/mqttClientId
Browse files Browse the repository at this point in the history
MQTTAscoltatore sends a clientId greater than 23 chars
  • Loading branch information
mcollina committed Jul 16, 2013
2 parents de77356 + d30b406 commit b54ca10
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/mqtt_ascoltatore.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var SubsCounter = require("./subs_counter");
* backed up by any MQTT broker out there.
*
* The options are:
* - `clientId`, the id of the MQTT client (max 23 chars)
* - `keepalive`, the keepalive timeout in seconds (see the MQTT spec), the default is 3000;
* - `port`, the port to connect to;
* - `host`, the host to connect to;
Expand All @@ -26,7 +27,6 @@ function MQTTAscoltatore(opts) {

this._opts = opts || {};
this._opts.keepalive = this._opts.keepalive || 3000;
this._opts.qos = this._opts.qos || 0;
this._opts.mqtt = this._opts.mqtt || require("mqtt");

this._subs_counter = new SubsCounter();
Expand Down Expand Up @@ -54,8 +54,7 @@ MQTTAscoltatore.prototype._startConn = function() {
if (this._client === undefined) {
settings = {
keepalive: that._opts.keepalive,
clientId: util.buildIdentifier(),
qos: that._opts.qos
clientId: that._opts.clientId,
};

debug("connecting..");
Expand Down

0 comments on commit b54ca10

Please sign in to comment.