From d78dd4897e79a9b873226af769f5249e69b18d36 Mon Sep 17 00:00:00 2001 From: "Robert (Jamie) Munro" Date: Wed, 22 Feb 2023 16:04:32 +0000 Subject: [PATCH] feat: allow other ART-NET apps on same machine (#35) By setting the "reuseAddr" option on the socket, multiple processes can bind to the UDP broadcasts on the socket. For example, I was able to connect the ChamSys MagicQ software running on the same machine once I set this. --- lib/artnet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/artnet.js b/lib/artnet.js index fe02094..fa03836 100644 --- a/lib/artnet.js +++ b/lib/artnet.js @@ -15,7 +15,7 @@ const MIN_PROTOCOL_VERSION = 14; class ArtNet { static listen(address, dmxHandler) { // Set up the socket - const socket = dgram.createSocket('udp4', (msg, peer) => { + const socket = dgram.createSocket({type: 'udp4', reuseAddr: true}, (msg, peer) => { const header = msg.toString('utf8', 0, 8); const opcode = msg.readUInt16LE(8); const version = msg.readUInt16BE(10);