Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary
2021-10-06 09:12:16 +01:00
7 changed files with 17 additions and 10 deletions

View File

@@ -372,12 +372,13 @@ module.exports = function(RED) {
socket.setKeepAlive(true,120000);
if (socketTimeout !== null) { socket.setTimeout(socketTimeout); }
node.log(RED._("tcpin.status.connection-from",{host:socket.remoteAddress, port:socket.remotePort}));
connectedSockets.push(socket);
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.length})});
socket.on('timeout', function() {
node.log(RED._("tcpin.errors.timeout",{port:node.port}));
socket.end();
});
socket.on('data', function(d) {
// console.log("DATA",d)
});
socket.on('close',function() {
node.log(RED._("tcpin.status.connection-closed",{host:socket.remoteAddress, port:socket.remotePort}));
connectedSockets.splice(connectedSockets.indexOf(socket),1);
@@ -388,6 +389,8 @@ module.exports = function(RED) {
connectedSockets.splice(connectedSockets.indexOf(socket),1);
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.length})});
});
connectedSockets.push(socket);
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.length})});
});
node.on("input", function(msg, nodeSend, nodeDone) {

View File

@@ -178,7 +178,7 @@ module.exports = function(RED) {
var sock;
var p = this.outport || this.port || "0";
node.tout = setTimeout(function() {
if (udpInputPortsInUse[p]) {
if ((p != 0) && udpInputPortsInUse[p]) {
sock = udpInputPortsInUse[p];
if (node.multicast != "false") {
sock.setBroadcast(true);

View File

@@ -47,5 +47,9 @@
<code>{{global.name}}</code>, or for persistable store <code>store</code> use <code>{{flow[store].name}}</code> or
<code>{{global[store].name}}</code>.
<p><b>Note: </b>By default, <i>mustache</i> will escape any non-alphanumeric or HTML entities in the values it substitutes.
To prevent this, use <code>{{{triple}}}</code> braces.
To prevent this, use <code>{{{triple}}}</code> braces.</p>
<p>If you need to use <code>{{ }}</code> within your content, you can change the characters
used to mark the templated sections. For example, to use <code>[[ ]]</code>
instead, add the following line to the top of the template:</p>
<pre>{{=[[ ]]=}}</pre>
</script>