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

Read address and port of discovered services #16

Closed
saket opened this issue Jun 22, 2021 · 4 comments
Closed

Read address and port of discovered services #16

saket opened this issue Jun 22, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@saket
Copy link
Contributor

saket commented Jun 22, 2021

When zeroconf announces itself, it includes details about its address and its port. Is this something that zeroconf can read about other devices when discovering them?

Announced Service{alias='alias', service='http', port=8080, text={}, addresses=[/192.168.xx.xx], domain='.local', protocol='tcp', host='host'}.

I'm currently broadcasting this information by using Service#setText and reading it back using DiscoveredService#getRelatedRecords(). Is there a better way of doing this?

@devgianlu
Copy link
Owner

That's the only way right now. Do you have a better API idea in mind? I made this one up very quickly.

@saket
Copy link
Contributor Author

saket commented Jun 22, 2021

What do you think of making properties of DiscoveredService?

discoveredService.addresses
discoveredService.port

@devgianlu
Copy link
Owner

I have pushed some code, does that fit your needs?

@saket
Copy link
Contributor Author

saket commented Jun 25, 2021

This looks great! Thank you for maintaining this library btw. It is so much simpler to use over everything else.

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

No branches or pull requests

2 participants