Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 having an uproarious good time at the Monastery: (8)
As of 2015-07-06 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls