Repository navigation
Add support for resolving non-service hostnames - #192
keepsimple1 merged 7 commits into
Conversation
26f6320 to
823132a
Compare
There was a problem hiding this comment.
Thank you for your PR! With a quick look, it didn't feel quite right for me, even though it is based on what already discussed. I left one inline comment, but I need more time to think through and review other parts.
(I'm hoping to simplify the current solution and still meet your needs)
823132a to
35c5422
Compare
keepsimple1
left a comment
There was a problem hiding this comment.
I went through the whole diff 😅 . It looks good to me overall. Please see inline for some comments. The main thing is still regarding the public API & enum. (That's always the hard part for a library ;-) ).
Also, could you please add test cases for this new feature? Thanks!
8540036 to
6e2762d
Compare
|
Okay, so I've added a |
69a8f32 to
ec0fd0a
Compare
ec0fd0a to
51098fa
Compare
|
Btw, I added support for sending multiple questions in one query. You can try out the new |
69e0b37 to
2b7ae71
Compare
2b7ae71 to
d1eb6d3
Compare
keepsimple1
left a comment
There was a problem hiding this comment.
Thank you for updating! Looks good! I only have one minor inline comment regarding naming.
d0e6ca6 to
1af65f9
Compare
1af65f9 to
69e6da2
Compare
Resolves #191.
This adds several pieces of public API, for resolving mDNS hostnames as standalone.
ServiceDaemon::resolve(&self, hostname: &str) -> Result<Receiver<ResolutionEvent>>ServiceDaemon::stop_resolve(&self, hostname: &str) -> Result<()>as well as
The internal implementation uses the dns cache for addresses, which should make it possible for service discovery and hostname discovery to benefit from each other in the case that you are running both at the same time.
The rest of the implementation is largely either copy paste of- or merging with the code that handles the service discovery, with some exceptions where the events are reporting an aggregate of ip-addresses rather than reporting one at a time.
Other notes
I refactored
DnsCache::evict_expiredto resolve some borrow checker issues. The current implementation will evict all expired records before it starts sending out events. It should not have any effect on any users ofServiceDaemon::browse, since they don't have direct access to the cache.The current implementation is a bit loud, because it's missing Known Answer Suppression (RFC6762, sec. 7.1) (which is stated as a MUST requirement). As far as I understand, the current implementation for service browsing does not have this either, so I think it should be considered as a new issue.