Open digipigeon opened 1 year ago
Just incase anyone else is looking for the same thing, it appears my specific use case can be done natively:
https://nodejs.org/api/dgram.html#socketsetrecvbuffersizesize
Even though setting SO_RCVBUF
can be done natively via socket.setRecvBufferSize()
, in order to investigate if this is a bug in node-sockopt
, can you provide more details about your environment?
uname -a
)node -v
)node-sockopt
version (npm ls --depth 5 | grep sockopt
)defaultBindIP
in your script above.I cannot reproduce the error; For me, assuming defaultBindIp
is 0.0.0.0
, with Node.js v20.6.1 on macOS 12.6.9, the output looks as follows:
UDP Started 0.0.0.0 9060
SO_RCVBUF is 786896
SO_RCVBUF is now 1024
(node:12424) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
@digipigeon Do you have any news about this?
Hello, I am starting a simple UDP listener and trying to adjust the receive buffer size, however even on reading the information, it seems to throw an error.
Code Snippet
This works fine without the
getsockopt
bits used.Which causes the following error: