zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.53k stars 2.34k forks source link

Add an option to select how address names are interpreted in zmq_bind #4514 #4560

Closed guill-delacourt closed 1 year ago

guill-delacourt commented 1 year ago

This PR partially fixes the issue #4514. It is currently limited to the the TCP sockets. This PR introduces a new socket option ZMQ_BIND_RESOLVE_NIC, by default set to true. When this option is set to true, names in addresses for binding sockets are resolved as network interface names, which is the current behaviour. When this option is set to false, names in addresses for binding sockets are resolved as hostnames, like non-binding sockets.

bluca commented 1 year ago

rather than a new option, probably better to just fallback to hostname resolving if interface resolving fails

guill-delacourt commented 1 year ago

OK, I'm closing this PR. I'll open a new one as changing the code to fallback to hostname resolving leads to simpler changes.