bytedance / node-unix-socket

Unix dgram, seqpacket, etc binding for Node.js.
https://bytedance.github.io/node-unix-socket/
MIT License
51 stars 0 forks source link

TCP_NODELAY #34

Open denyaalt opened 8 months ago

denyaalt commented 8 months ago

Hi, Is it possible to add the TCP_NODELAY setting to SO_REUSEPORT to use them together? Thanks.

oyyd commented 1 month ago

If it's as simple as adding a socket flag, then yes. Moreover, this module already allows SO_REUSEPORT.

oyyd commented 1 month ago

Node.js allows setting noDeply option for net.Server. Therefore you can set the option with SO_REUSEPORT.

Example:

const fd = createReuseportFd(port, host);
const server = net.createServer({ noDelay: true })
server.listen(fd)