Skip to content

Commit

Permalink
feat: allow other ART-NET apps on same machine (#35)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rjmunro authored Feb 22, 2023
1 parent 6aa6a57 commit d78dd48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/artnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d78dd48

Please sign in to comment.