<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>offTheHill &#187; mdnsresponder</title>
	<atom:link href="http://www.offthehill.org/articles/tag/mdnsresponder/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.offthehill.org</link>
	<description>tech, motorsports, and the occasional artwork</description>
	<lastBuildDate>Wed, 05 May 2010 23:39:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.4" -->
		<copyright>2006-2007 </copyright>
		<managingEditor>josh@offthehill.org (offTheHill)</managingEditor>
		<webMaster>josh@offthehill.org (offTheHill)</webMaster>
		<category>posts</category>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Babbling my way across the Internet</itunes:summary>
		<itunes:author>offTheHill</itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name>offTheHill</itunes:name>
			<itunes:email>josh@offthehill.org</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://www.offthehill.org/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://www.offthehill.org/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>offTheHill</title>
			<link>http://www.offthehill.org</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>How To use the Java mDNS Wrapper</title>
		<link>http://www.offthehill.org/articles/2008/01/10/how-to-use-the-java-mdns-wrapper/</link>
		<comments>http://www.offthehill.org/articles/2008/01/10/how-to-use-the-java-mdns-wrapper/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 22:21:25 +0000</pubDate>
		<dc:creator>pardsbane</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bonjour]]></category>
		<category><![CDATA[dns service discovery]]></category>
		<category><![CDATA[dns-sd]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jmdns]]></category>
		<category><![CDATA[mdns]]></category>
		<category><![CDATA[mdnsresponder]]></category>
		<category><![CDATA[zeroconf]]></category>

		<guid isPermaLink="false">http://www.offthehill.org/articles/2008/01/10/how-to-use-the-java-mdns-wrapper/</guid>
		<description><![CDATA[	A few days ago I posted an article about my wrapper API which unifies the mDNSResponder and JmDNS packages behind a single interface, but I neglected to provide usage examples or a usage guide. I&#8217;ll try and correct that now.

	In addition to unifying multiple mDNS implementations under a single API, I think my API reduces [...]]]></description>
			<content:encoded><![CDATA[	<p>A few days ago I<a href="http://www.offthehill.org/articles/2008/01/08/a-jmdns-mdnsresponder-zeroconf-compatibility-interface/"> posted an article</a> about my wrapper <span class="caps">API</span> which unifies the mDNSResponder and JmDNS packages behind a single interface, but I neglected to provide usage examples or a usage guide. I&#8217;ll try and correct that now.</p>

	<p>In addition to unifying multiple mDNS implementations under a single <span class="caps">API</span>, I think my <span class="caps">API</span> reduces the amount of work needed by the developer for registering and listening for services to a minimum.</p>

	<p><strong>Building the code</strong><br />
First off, all you should need to  compile and run my package is <a href="http://maven.apache.org">Maven</a>. Once you have Maven installed, cd into the jmdns directory, and run:</p>

	<p><code>mvn test</code></p>

	<p>This will compile JmDNS, my add-on <span class="caps">API</span>, and run a few unit tests. The <span class="caps">API</span> in question is tested by <code>org.jmdns.api.DiscoveryFactoryTest</code>. I would expect the JmDNS portion of the test <code>testJmDNS()</code> to pass under almost any circumstance, but the <code>testmDNSResponder()</code> will only pass if you are running on Linux and have mDNSResponder (or possibly the avahi compatibility layer) installed successfully.</p>

	<p><strong>Example usage &#8211; Initialization</strong></p>

	<p>Before registering or listening for services, you need to initialize the discovery subsystem:</p>

	<p><code>DiscoveryFactory.initRegistry(
DiscoveryFactory.DISCOVERY_REGISTRY_DEFAULT);</code></p>

	<p>The above will use the default mDNS implementation (JmDNS). Alternatively you can use the following to use JmDNS explicitly:</p>

	<p><code>DiscoveryFactory.initRegistry(
DiscoveryFactory.DISCOVERY_REGISTRY_JMDNS);</code></p>

	<p>Or mDNSResponder instead:</p>

	<p><code>DiscoveryFactory.initRegistry(
DiscoveryFactory.DISCOVERY_REGISTRY_MDNSRESPONDER);</code></p>

	<p>Consider this an initialization a singleton, you should do this once and only once per <span class="caps">JVM</span> instance.</p>

	<p><strong>Example usage &#8211; Registering a Service</strong></p>

	<p>Assuming the system is initialized, the following code will register a service:</p>

	<p><code>HashMap&#60;string,&#62; props = new HashMap&#60;string,&#62;();
props.put(&#34;type&#34;, &#34;website&#34;);&#60;/string,&#62;&#60;/string,&#62;</code></p>

	<p><code>IDiscoveryRegistry registry = DiscoveryFactory.getRegistry();</code></p>

	<p><code>IServiceInfo myService = registry.registerService(&#34;_http._tcp&#34;, &#34;mySite&#34;, null, 80, props);
</code></p>

	<p>Note the &#8216;null&#8217; in the registerService() call is to use the default domain (.local). You can pass a domain name here to register in another domain.</p>

	<p>To unregister your service, just do:</p>

	<p><code>registry.unregisterService(myService);</code></p>

	<p><strong>Example usage &#8211; Listening for a Service</strong></p>

	<p>Create a listener:</p>

	<p><code>BaseDiscoveryListener listener = new BaseDiscoveryListener(&#34;_http._tcp&#34;, &#34;website&#34;, null);</code></p>

	<p>Wait 15 seconds for a service:</p>

	<p><code>listener.waitForFirstService(15000);</code></p>

	<p>Get the first service found:</p>

	<p><code>IServiceInfo service = listener.getFirstService();</code></p>

	<p>Print out some information on the service:</p>

	<p><code>System.out.println(&#34;service name: &#34; + service.getName() + &#34; at &#34; + service.getHostAddress() + &#34;, port: &#34; + service.getPort());</code></p>]]></content:encoded>
			<wfw:commentRss>http://www.offthehill.org/articles/2008/01/10/how-to-use-the-java-mdns-wrapper/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A JmDNS / mDNSResponder Zeroconf Compatibility Interface</title>
		<link>http://www.offthehill.org/articles/2008/01/08/a-jmdns-mdnsresponder-zeroconf-compatibility-interface/</link>
		<comments>http://www.offthehill.org/articles/2008/01/08/a-jmdns-mdnsresponder-zeroconf-compatibility-interface/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 16:54:35 +0000</pubDate>
		<dc:creator>pardsbane</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bonjour]]></category>
		<category><![CDATA[dns service discovery]]></category>
		<category><![CDATA[dns-sd]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jmdns]]></category>
		<category><![CDATA[mdns]]></category>
		<category><![CDATA[mdnsresponder]]></category>
		<category><![CDATA[zeroconf]]></category>

		<guid isPermaLink="false">http://www.offthehill.org/articles/2008/01/08/a-jmdns-mdnsresponder-zeroconf-compatibility-interface/</guid>
		<description><![CDATA[	My company has given me permission to release a Java Zeroconf API. The advantage of this API is that it allows the application to select which implementing library to use at runtime, and eases developer work implementing mDNS / DNS-SD. I also think my API is easier to understand than the raw interfaces of the [...]]]></description>
			<content:encoded><![CDATA[	<p>My company has given me permission to release a Java <a href="http://en.wikipedia.org/wiki/Zeroconf">Zeroconf</a> <span class="caps">API</span>. The advantage of this <span class="caps">API</span> is that it allows the application to select which implementing library to use at runtime, and eases developer work implementing mDNS / <span class="caps">DNS-SD</span>. I also think my <span class="caps">API</span> is easier to understand than the raw interfaces of the underlying implementations.</p>

	<p>Currently there are two implementing backends, one for <a href="http://jmdns.sourceforge.net/">JmDNS</a> and one for Apple&#8217;s <a href="http://developer.apple.com/networking/bonjour/">mDNSResponder</a>. I would really like to see one written for <a href="http://avahi.org/">Avahi</a>, but I probably won&#8217;t get to it myself.</p>

	<p>The <span class="caps">API</span> is in the <em>org.jmdns.api</em> package, which both implementations are in the <em>org.jmdns.impl</em> package. A unit test is also included which demonstrates usage and verifies operation.</p>

	<p>I&#8217;ve implemented this version within the JmDNS source tree, but ideally the <span class="caps">API</span>, JmDNS and mDNSResponder portions of the code would be broken out to be separately distributed, with the JmDNS and mDNSResponder portions functioning as plugins implementing the <span class="caps">API</span>.</p>

	<p>I&#8217;ve only tested this against mDNSResponder 107.5. I&#8217;m not sure if Apple&#8217;s dnssd.jar is compatible with newer mDNSResponder versions or not.</p>

	<p>You can download the full implementation here: <a href="http://www.offthehill.org/wp-content/uploads/2008/01/jmdns-kiva-113tar.bz2" title="jmdns-kiva-1.1.3.tar.bz2">jmdns-kiva-1.1.3.tar.bz2</a></p>

	<p>I hope the JmDNS project will pick this effort up and incorporate this into the official release!</p>]]></content:encoded>
			<wfw:commentRss>http://www.offthehill.org/articles/2008/01/08/a-jmdns-mdnsresponder-zeroconf-compatibility-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mDNSResponder / GCC 4.1 / Ubuntu Problem persists</title>
		<link>http://www.offthehill.org/articles/2007/05/04/mdnsresponder-gcc-4-1-ubuntu-problem-persists/</link>
		<comments>http://www.offthehill.org/articles/2007/05/04/mdnsresponder-gcc-4-1-ubuntu-problem-persists/#comments</comments>
		<pubDate>Fri, 04 May 2007 14:52:08 +0000</pubDate>
		<dc:creator>pardsbane</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[bonjour]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mdnsresponder]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[zeroconf]]></category>

		<guid isPermaLink="false">1074094331</guid>
		<description><![CDATA[	A while back
I reported on an obscure problem when compiling applications against the dnssd library that comes with Apple&#8217;s mDNSResponder.

	This post is just to report that these problems persist in mDNSResponder 108.4. As I reported before, here is what you&#8217;ll see when compiling your program:

	
hidden symbol `__stack_chk_fail_local&#39;
in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO
/usr/bin/ld: final link failed: [...]]]></description>
			<content:encoded><![CDATA[	<p>A <a href="http://www.offthehill.org/articles/2007/01/23/mdnsresponder-and-gcc-4-1-compiling-issues">while back</a><br />
I reported on an obscure problem when compiling applications against the dnssd library that comes with Apple&#8217;s mDNSResponder.</p>

	<p>This post is just to report that these problems persist in mDNSResponder 108.4. As I reported before, here is what you&#8217;ll see when compiling your program:</p>

	<p><code>
hidden symbol `__stack_chk_fail_local&#39;
in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
</code></p>

	<p>As you can see, its all very intuitive.</p>]]></content:encoded>
			<wfw:commentRss>http://www.offthehill.org/articles/2007/05/04/mdnsresponder-gcc-4-1-ubuntu-problem-persists/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
