node-ssdp icon indicating copy to clipboard operation
node-ssdp copied to clipboard

Error: write ENOTSUP

Open diegocr opened this issue 5 years ago • 1 comments

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: write ENOTSUP
    at ChildProcess.target._send (internal/child_process.js:750:20)
    at ChildProcess.target.send (internal/child_process.js:634:19)
    at sendHelper (internal/cluster/utils.js:24:15)

This error is throw in Windows when using node-ssdp from a cluster's worker - long story short, the socket needs to be bind'ed with the exclusive flag set.

See https://github.com/wankdanker/node-discover/issues/18

diegocr avatar May 02 '19 20:05 diegocr

Actually there is a quite trivial workaround for this:

const SSDP = require('node-ssdp').Server, server = new SSDP({
            reuseAddr: false,
            sourcePort: {
                port: 1900, exclusive: true
            },
      ......
});

Although this throws the warning:

WARNING: SSDP server `sourcePort` option is set to non-SSDP port....

but meh, it does work now :)

diegocr avatar May 02 '19 21:05 diegocr