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.


In reply to AnyEvent::DNS for mDNS queries? by creeble

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.