tcp node add reply (to all) capability

if no _session present.
This commit is contained in:
Dave Conway-Jones
2016-02-12 13:17:50 +00:00
parent d69bcad028
commit 7f6915eb59
2 changed files with 21 additions and 8 deletions

View File

@@ -303,6 +303,17 @@ module.exports = function(RED) {
}
}
}
else {
for (var i in connectionPool) {
if (Buffer.isBuffer(msg.payload)) {
connectionPool[i].write(msg.payload);
} else if (typeof msg.payload === "string" && node.base64) {
connectionPool[i].write(new Buffer(msg.payload,'base64'));
} else {
connectionPool[i].write(new Buffer(""+msg.payload));
}
}
}
});
} else {
var connectedSockets = [];