mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Don't accidentally re-use udp port when set to not do so
to close Issue #1764
This commit is contained in:
parent
6f5974f875
commit
9d219c163d
@ -63,7 +63,7 @@ module.exports = function(RED) {
|
|||||||
udpInputPortsInUse[this.port] = server;
|
udpInputPortsInUse[this.port] = server;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.warn(RED._("udp.errors.alreadyused",{port:node.port}));
|
node.log(RED._("udp.errors.alreadyused",{port:node.port}));
|
||||||
server = udpInputPortsInUse[this.port]; // re-use existing
|
server = udpInputPortsInUse[this.port]; // re-use existing
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +172,7 @@ module.exports = function(RED) {
|
|||||||
if (process.version.indexOf("v0.10") === 0) { opts = node.ipv; }
|
if (process.version.indexOf("v0.10") === 0) { opts = node.ipv; }
|
||||||
|
|
||||||
var sock;
|
var sock;
|
||||||
var p = this.port;
|
var p = this.outport || this.port || "0";
|
||||||
if (node.multicast != "false") { p = this.outport||"0"; }
|
|
||||||
if (udpInputPortsInUse[p]) {
|
if (udpInputPortsInUse[p]) {
|
||||||
sock = udpInputPortsInUse[p];
|
sock = udpInputPortsInUse[p];
|
||||||
node.log(RED._("udp.status.re-use",{outport:node.outport,host:node.addr,port:node.port}));
|
node.log(RED._("udp.status.re-use",{outport:node.outport,host:node.addr,port:node.port}));
|
||||||
|
Loading…
Reference in New Issue
Block a user