Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

AnyEvent::DNS for mDNS queries?

by creeble (Sexton)
on Apr 24, 2012 at 23:56 UTC ( #966965=perlquestion: print w/ replies, xml ) Need Help??
creeble has asked for the wisdom of the Perl Monks concerning the following question:

I want to use AnyEvent::DNS to do mDNS queries. I tried AnyEvent::mDNS, but it is apparently quite broken, as AnyEvent::Handle doesn't do udp sockets.

I'm looking at the code from AnyEvent::mDNS and trying to figure out how to splice it into/subclass AnyEvent::DNS. I know, for example, that AnyEvent::DNS needs to be subclassed in at least a couple of places where it has the port hard-coded as 53 (want 5353 for mDNS).

But after that, I'm getting super lost -- I know that the query is multicast to 224.0.0.251, is this the server address? And I know I want a PTR record, and I think I can pack up the actual data request with:

$pkt = AnyEvent::DNS::dns_pack({rd => 1, qd => [ [sprintf ('_%s._tcp.local', $service), 'PTR'] +] });
but where does this $pkt get used in AnyEvent::DNS's API?

Eric.

Comment on AnyEvent::DNS for mDNS queries?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://966965]
Approved by sundialsvc4
Front-paged by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-07-30 12:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (231 votes), past polls