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