Closed somec closed 5 years ago
Hi @somec
While I appreciate this patch request I will not be merging it.
For the bind to device functionality you can already do this using a socket option, so this really should be done in JavaScript (i.e. index.js) and not in C++.
Additionally, I am not sure I see the benefit of binding to a specific IP address, specifically for a raw socket socket. If you really do need to control the source IP address then you should consider using IP_HDRINCL
socket option and control that yourself.
Steve
On a multihomed node it might be wanted to bind the socket to a specific address or interface.
Added two functions:
bindToAddress(address) address : The ip address to bind the socket to.
bindToDevice(device) (linux only) device: The device name to bind the socket to.