Add use strict to mqtt node, allow will parm to be passed.

This commit is contained in:
Dave C-J
2014-05-29 09:00:28 +01:00
parent 1d5e8de6f6
commit 7ad28de52a
2 changed files with 20 additions and 21 deletions

View File

@@ -28,7 +28,7 @@ function matchTopic(ts,t) {
}
module.exports = {
get: function(broker,port,clientid,username,password) {
get: function(broker,port,clientid,username,password,will) {
var id = "["+(username||"")+":"+(password||"")+"]["+(clientid||"")+"]@"+broker+":"+port;
if (!connections[id]) {
connections[id] = function() {
@@ -40,6 +40,7 @@ module.exports = {
options.clientId = clientid || 'mqtt_' + (1+Math.random()*4294967295).toString(16);
options.username = username;
options.password = password;
options.will = will;
var queue = [];
var subscriptions = [];
var connecting = false;
@@ -125,4 +126,3 @@ module.exports = {
return connections[id];
}
};