-
Notifications
You must be signed in to change notification settings - Fork 120
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
Multicast client answer should not be discarded when doing one-shot discovery #60
Comments
Well, that portion of the RFC is related to the query itself. The section related to answers is
That said, the problem is that unicast bit is set when sending a query from a higher numbered ephemeral port, in which case the socket will not receive any multicast response (since that is delivered on port 5353) - so by definition the socket cannot read that data. So yes, the library does support multicast response, but it requires you to have a second socket open and bound to multicast on port 5353. In which case you will probably send the query from that socket anyway. |
Indeed, the section was related to the query. However, these packets are not being received by the socket (at least on macOS), which seems to only receive the multicast ones. Not sure where the packet goes (maybe catched by the native Bonjour ?). Somehow, this is logical as the discovery query is QU (0x80). Changing the discovery query to QM (0x00) make the discovery working, but it means editing the library itself. |
Ok, working with multiple sockets I discovered an issue in the library. According to the documentation I had to implement this in the socket_seup function to have a proper binding and avoid responses being received by the wrong socket (fixed for macOS, untested for Linux, did not touch the bind for Windows as I have no access to a test machine):
|
Thank you for the additional info, I will certainly have to look into this in more detail |
We noticed that this library detect less devices than avahi or gstreamer mdns library (libmicrodns). It appears that when doing one shot query, some devices respond with multicast even if unicast is requested in the query.
This is actually accepted by the RFC:
However this is not supported by this library.
The text was updated successfully, but these errors were encountered: