mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Move udp sock error listener to only be instantiated once.
This commit is contained in:
		| @@ -130,15 +130,15 @@ module.exports = function(RED) { | ||||
|         } | ||||
|         else { | ||||
|             sock = dgram.createSocket(opts);  // default to udp4 | ||||
|             sock.on("error", function(err) { | ||||
|                 // Any async error will also get reported in the sock.send call. | ||||
|                 // This handler is needed to ensure the error marked as handled to | ||||
|                 // prevent it going to the global error handler and shutting node-red | ||||
|                 // down. | ||||
|             }); | ||||
|             udpInputPortsInUse[this.outport] = sock; | ||||
|         } | ||||
|  | ||||
|         sock.on("error", function(err) { | ||||
|             // Any async error will also get reported in the sock.send call. | ||||
|             // This handler is needed to ensure the error marked as handled to | ||||
|             // prevent it going to the global error handler and shutting node-red | ||||
|             // down. | ||||
|         }); | ||||
|         if (node.multicast != "false") { | ||||
|             if (node.outport === "") { node.outport = node.port; } | ||||
|             sock.bind(node.outport, function() {    // have to bind before you can enable broadcast... | ||||
|   | ||||
		Reference in New Issue
	
	Block a user