For Windows, MacOS, or any Linux distro not specified on the docs page, passing the reusePort=true option for net.server.listen results in server termination.
Is it required that a server terminates in this case, or can there be a graceful fallback for unsupported systems (e.g. default to false on systems that do not support SO_REUSEPORT)?
It appears that there is prior art for platform specific behavior. Could we use a similar pattern to gracefully handle reusePort?
| if(isWindows){ |
| constinstances=NumberParseInt(process.env.NODE_PENDING_PIPE_INSTANCES); |
| if(!NumberIsNaN(instances)){ |
| handle.setPendingInstances(instances); |
| } |
| } |
| }else{ |
| handle=newTCP(TCPConstants.SERVER); |
| isTCP=true; |
| } |
For Windows, MacOS, or any Linux distro not specified on the docs page, passing the
reusePort=trueoption fornet.server.listenresults in server termination.Is it required that a server terminates in this case, or can there be a graceful fallback for unsupported systems (e.g. default to false on systems that do not support
SO_REUSEPORT)?It appears that there is prior art for platform specific behavior. Could we use a similar pattern to gracefully handle
reusePort?node/lib/net.js
Lines 1852 to 1861 in e28656a