Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iface selection #28

Closed
Zulu-Inuoe opened this issue Aug 5, 2022 · 1 comment
Closed

iface selection #28

Zulu-Inuoe opened this issue Aug 5, 2022 · 1 comment

Comments

@Zulu-Inuoe
Copy link

I've noticed the behaviour of iface is, to me, surprising.

From the Zyre reference implementation in C :

//  Set network interface for UDP beacons. If you do not set this, CZMQ will
//  choose an interface for you. On boxes with several interfaces you should
//  specify which one you want to use, or strange things can happen.
//  The interface may by specified by either the interface name e.g. "eth0" or
//  an IP address associalted with the interface e.g. "192.168.0.1"
ZYRE_EXPORT void
    zyre_set_interface (zyre_t *self, const char *value);

Note that we can specify IP address.

However, looking at the algorithm used in zyre.js, it only accepts the interface name.

My desire is, on Windows, to supply 127.0.0.1 to denote the loopback adapter 'pseudo interface'.
I'm willing to make the change & PR but wanted to clarify this.

Additionally, even if I do supply the adapter name, I run into the situation where the code fails to accept it because it is marked as 'internal'

image

Note the adapter is marked as private.
The code has the logic of declining to use nay with .internal being truthy.
This makes sense to me if the user did not explicitly supply an adapter (select the first public iface). But if they specify an adapter, what does it matter if it's public/private?

I'd appreciate any thoughts!

@interpretor
Copy link
Owner

interpretor commented Aug 20, 2022

Good find, thank you.
I changed the behavior, it should behave now similar to the Zyre implementation in C.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants