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

tidy up udp node - repeat setting of var

This commit is contained in:
Dave Conway-Jones 2016-10-25 20:33:26 +01:00
parent 3ab0d0d865
commit 45eba5cabd

View File

@ -43,9 +43,7 @@ module.exports = function(RED) {
server = udpInputPortsInUse[this.port]; // re-use existing
}
var opts = {type:node.ipv, reuseAddr:true};
if (process.version.indexOf("v0.10") === 0) { opts = node.ipv; }
var server = dgram.createSocket(opts); // default to udp4
server.on("error", function (err) {
if ((err.code == "EACCES") && (node.port < 1024)) {