File: C:/Ruby27-x64/share/doc/ruby/html/Resolv/MDNS.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>class Resolv::MDNS - RDoc Documentation</title>
<script type="text/javascript">
var rdoc_rel_prefix = "../";
var index_rel_prefix = "../";
</script>
<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>
<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">
<body id="top" role="document" class="class">
<nav role="navigation">
<div id="project-navigation">
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="../index.html" rel="home">Home</a>
</h2>
<div id="table-of-contents-navigation">
<a href="../table_of_contents.html#pages">Pages</a>
<a href="../table_of_contents.html#classes">Classes</a>
<a href="../table_of_contents.html#methods">Methods</a>
</div>
</div>
<div id="search-section" role="search" class="project-section initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<div id="search-field-wrapper">
<input id="search-field" role="combobox" aria-label="Search"
aria-autocomplete="list" aria-controls="search-results"
type="text" name="search" placeholder="Search" spellcheck="false"
title="Type to search, Up and Down to navigate, Enter to load">
</div>
<ul id="search-results" aria-label="Search Results"
aria-busy="false" aria-expanded="false"
aria-atomic="false" class="initially-hidden"></ul>
</form>
</div>
</div>
<div id="class-metadata">
<div id="parent-class-section" class="nav-section">
<h3>Parent</h3>
<p class="link"><a href="DNS.html">Resolv::DNS</a>
</div>
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
<h3>Methods</h3>
<ul class="link-list" role="directory">
<li class="calls-super" ><a href="#method-c-new">::new</a>
<li class="calls-super" ><a href="#method-i-each_address">#each_address</a>
</ul>
</div>
</div>
</nav>
<main role="main" aria-labelledby="class-Resolv::MDNS">
<h1 id="class-Resolv::MDNS" class="class">
class Resolv::MDNS
</h1>
<section class="description">
<p><a href="MDNS.html"><code>Resolv::MDNS</code></a> is a one-shot Multicast <a href="DNS.html"><code>DNS</code></a> (mDNS) resolver. It blindly makes queries to the mDNS addresses without understanding anything about multicast ports.</p>
<p>Information taken form the following places:</p>
<ul><li>
<p>RFC 6762</p>
</li></ul>
</section>
<section id="5Buntitled-5D" class="documentation-section">
<section class="constants-list">
<header>
<h3>Constants</h3>
</header>
<dl>
<dt id="AddressV4">AddressV4
<dd><p>Default <a href="IPv4.html"><code>IPv4</code></a> mDNS address</p>
<dt id="AddressV6">AddressV6
<dd><p>Default <a href="IPv6.html"><code>IPv6</code></a> mDNS address</p>
<dt id="Addresses">Addresses
<dd><p>Default mDNS addresses</p>
<dt id="Port">Port
<dd><p>Default mDNS <a href="MDNS.html#Port"><code>Port</code></a></p>
</dl>
</section>
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Class Methods</h3>
</header>
<div id="method-c-new" class="method-detail ">
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">(config_info=nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Creates a new one-shot Multicast <a href="DNS.html"><code>DNS</code></a> (mDNS) resolver.</p>
<p><code>config_info</code> can be:</p>
<dl class="rdoc-list note-list"><dt>nil
<dd>
<p>Uses the default mDNS addresses</p>
</dd><dt><a href="../Hash.html"><code>Hash</code></a>
<dd>
<p>Must contain :nameserver or :nameserver_port like Resolv::DNS#initialize.</p>
</dd></dl>
<div class="method-calls-super">
Calls superclass method
<a href="DNS.html#method-c-new"><code>Resolv::DNS::new</code></a>
</div>
<div class="method-source-code" id="new-source">
<pre><span class="ruby-comment"># File lib/resolv.rb, line 2615</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">config_info</span>=<span class="ruby-keyword">nil</span>)
<span class="ruby-keyword">if</span> <span class="ruby-identifier">config_info</span> <span class="ruby-keyword">then</span>
<span class="ruby-keyword">super</span>({ <span class="ruby-value">nameserver_port:</span> <span class="ruby-constant">Addresses</span> }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">config_info</span>))
<span class="ruby-keyword">else</span>
<span class="ruby-keyword">super</span>(<span class="ruby-value">nameserver_port:</span> <span class="ruby-constant">Addresses</span>)
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</section>
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Instance Methods</h3>
</header>
<div id="method-i-each_address" class="method-detail ">
<div class="method-heading">
<span class="method-name">each_address</span><span
class="method-args">(name)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>Iterates over all IP addresses for <code>name</code> retrieved from the mDNS resolver, provided name ends with “local”. If the name does not end in “local” no records will be returned.</p>
<p><code>name</code> can be a <a href="DNS/Name.html"><code>Resolv::DNS::Name</code></a> or a <a href="../String.html"><code>String</code></a>. Retrieved addresses will be a <a href="IPv4.html"><code>Resolv::IPv4</code></a> or <a href="IPv6.html"><code>Resolv::IPv6</code></a></p>
<div class="method-calls-super">
Calls superclass method
<a href="DNS.html#method-i-each_address"><code>Resolv::DNS#each_address</code></a>
</div>
<div class="method-source-code" id="each_address-source">
<pre><span class="ruby-comment"># File lib/resolv.rb, line 2631</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each_address</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-identifier">name</span> = <span class="ruby-constant">Resolv</span><span class="ruby-operator">::</span><span class="ruby-constant">DNS</span><span class="ruby-operator">::</span><span class="ruby-constant">Name</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>[<span class="ruby-value">-1</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-string">'local'</span>
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</section>
</section>
</main>
<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.1.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>