-
Notifications
You must be signed in to change notification settings - Fork 43
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
Send SearchStarted events with addrs as ip (intf-name)
#245
Send SearchStarted events with addrs as ip (intf-name)
#245
Conversation
Otherwise the output gets pretty cluttered when running the query example
An alternative would be to print interface names. But therefore we would need to update the if_addrs crate. As the currently used version only would print he GUID instead of the friendly name of the interface when running on windows. That change was introduced with messense/if-addrs#34 which is available since https://crates.io/crates/if-addrs/0.12.0, we are using https://crates.io/crates/if-addrs/0.10.2 |
Thanks for this PR!
A good finding! Would you please update |
src/service_daemon.rs
Outdated
@@ -2038,7 +2038,7 @@ impl Zeroconf { | |||
next_delay: u32, | |||
listener: Sender<ServiceEvent>, | |||
) { | |||
let addr_list: Vec<_> = self.intf_socks.keys().collect(); | |||
let addr_list: Vec<_> = self.intf_socks.keys().map(|itf| itf.addr.ip()).collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, you can just call itf.ip()
.
src/service_daemon.rs
Outdated
@@ -2038,7 +2038,7 @@ impl Zeroconf { | |||
next_delay: u32, | |||
listener: Sender<ServiceEvent>, | |||
) { | |||
let addr_list: Vec<_> = self.intf_socks.keys().collect(); | |||
let addr_list: Vec<_> = self.intf_socks.keys().map(|itf| itf.addr.ip()).collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the general comment I gave, maybe we could print both IP and name by doing something like:
let addr_list: Vec<_> = self.intf_socks.keys().map(|itf| (itf.ip(), itf.name)).collect();
(I didn't try locally, so just a thought)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's simpler, but I personally find the <ip> (<itf-name>)
more pleasant to read :)
Yes will do, without the update of the crate if_addrs on windows that would look like this:
With the crate updated:
|
ip (name)
ip (name)
ip (intf-name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new print output looks really nice! Thanks!
Otherwise the output gets pretty cluttered when running the query example
With the change to Map(Interface, Socket) in #242
The outpout looks a bit odd and too verbose when expecting addrs:
This change brings back the output like it was before:
Update to
<ip> (<intf-name>)
, where i also aligned the query example output of other events with ServiceResolved()