1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Final TCP node nits - let 0 do it's thing as per every other timeout

This commit is contained in:
Dave Conway-Jones 2017-05-11 19:11:51 +01:00
parent 6b4e15dd0f
commit b43d566968
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D
2 changed files with 10 additions and 13 deletions

View File

@ -21,7 +21,7 @@
<option value="server" data-i18n="tcpin.type.listen"></option> <option value="server" data-i18n="tcpin.type.listen"></option>
<option value="client" data-i18n="tcpin.type.connect"></option> <option value="client" data-i18n="tcpin.type.connect"></option>
</select> </select>
<span data-i18n="tcpin.label.port"></span> <input type="text" id="node-input-port" style="width: 65px"> <span data-i18n="tcpin.label.port"></span> <input type="text" id="node-input-port" style="width:65px">
</div> </div>
<div class="form-row hidden" id="node-input-host-row" style="padding-left: 110px;"> <div class="form-row hidden" id="node-input-host-row" style="padding-left: 110px;">
<span data-i18n="tcpin.label.host"></span> <input type="text" id="node-input-host" placeholder="localhost" style="width: 60%;"> <span data-i18n="tcpin.label.host"></span> <input type="text" id="node-input-host" placeholder="localhost" style="width: 60%;">
@ -41,8 +41,8 @@
<span data-i18n="tcpin.label.payload"></span> <span data-i18n="tcpin.label.payload"></span>
</div> </div>
<div id="node-row-newline" class="form-row hidden" style="padding-left: 110px;"> <div id="node-row-newline" class="form-row hidden" style="padding-left:110px;">
<span data-i18n="tcpin.label.delimited"></span> <input type="text" id="node-input-newline" style="width: 110px;"> <span data-i18n="tcpin.label.delimited"></span> <input type="text" id="node-input-newline" style="width:110px;">
</div> </div>
<div class="form-row"> <div class="form-row">
@ -249,7 +249,7 @@
color:"Silver", color:"Silver",
defaults: { defaults: {
server: {value:""}, server: {value:""},
port: {value:"",validate:RED.validators.regex(/^( \d*|)$/)}, port: {value:"",validate:RED.validators.regex(/^(\d*|)$/)},
out: {value:"time",required:true}, out: {value:"time",required:true},
splitc: {value:"0",required:true}, splitc: {value:"0",required:true},
name: {value:""} name: {value:""}
@ -284,7 +284,7 @@
$("#node-units").text("chars"); $("#node-units").text("chars");
} }
else { else {
if (previous != "sit") { $("#node-input-splitc").val("0"); } if (previous != "sit") { $("#node-input-splitc").val(" "); }
$("#node-units").text(""); $("#node-units").text("");
} }
}); });

View File

@ -467,10 +467,10 @@ module.exports = function(RED) {
node.send(RED.util.cloneMessage(clients[connection_id].msg)); node.send(RED.util.cloneMessage(clients[connection_id].msg));
} }
} }
else if (node.splitc === 0) { // else if (node.splitc === 0) {
clients[connection_id].msg.payload = data; // clients[connection_id].msg.payload = data;
node.send(clients[connection_id].msg); // node.send(clients[connection_id].msg);
} // }
else { else {
for (var j = 0; j < data.length; j++ ) { for (var j = 0; j < data.length; j++ ) {
if (node.out === "time") { if (node.out === "time") {
@ -617,10 +617,7 @@ module.exports = function(RED) {
break; break;
} }
} }
if (!anyConnected) { clients = {}; }
if (!anyConnected) {
clients = {};
}
done(); done();
}); });