<?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/"
	>

<channel>
	<title>Smallegan.com &#187; Work</title>
	<atom:link href="http://www.smallegan.com/blog/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smallegan.com/blog</link>
	<description>Geeks rule the world.</description>
	<lastBuildDate>Sun, 05 Sep 2010 07:04:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Thursday in cubeland&#8230;.</title>
		<link>http://www.smallegan.com/blog/2008/07/24/thursday-in-cubeland/</link>
		<comments>http://www.smallegan.com/blog/2008/07/24/thursday-in-cubeland/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 19:35:37 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=157</guid>
		<description><![CDATA[Thursday in cubeland&#8230;.


]]></description>
			<content:encoded><![CDATA[<p></p><p>Thursday in cubeland&#8230;.</p>
<p><a href="http://www.smallegan.com/blog/wp-content/uploads/2008/07/p-640-480-89b8e125-aab1-468c-b0df-305becda0d86.jpeg"><img class="alignnone size-full wp-image-155" title="p-640-480-89b8e125-aab1-468c-b0df-305becda0d86.jpeg" src="http://www.smallegan.com/blog/wp-content/uploads/2008/07/p-640-480-89b8e125-aab1-468c-b0df-305becda0d86.jpeg" alt="" width="288" height="384" /></a></p>
<p><a href="http://www.smallegan.com/blog/wp-content/uploads/2008/07/p-640-480-89b8e125-aab1-468c-b0df-305becda0d86.jpeg"></a><a href="http://www.smallegan.com/blog/wp-content/uploads/2008/07/l-640-480-da9a8a59-d004-488f-b03a-17966cebeaea.jpeg"><img class="alignnone size-full wp-image-156" title="l-640-480-da9a8a59-d004-488f-b03a-17966cebeaea.jpeg" src="http://www.smallegan.com/blog/wp-content/uploads/2008/07/l-640-480-da9a8a59-d004-488f-b03a-17966cebeaea.jpeg" alt="" width="384" height="288" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2008/07/24/thursday-in-cubeland/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes Library on the go?</title>
		<link>http://www.smallegan.com/blog/2008/06/23/itunes-library-on-the-go/</link>
		<comments>http://www.smallegan.com/blog/2008/06/23/itunes-library-on-the-go/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 18:43:09 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=152</guid>
		<description><![CDATA[I have tried a number of different solutions for getting my iTunes library on my remote machine(s). Within my local network iTunes takes just a few seconds using Zeroconf / BonjourÂ technology to find my library and then a few more seconds to load the XML file containing the definitions my 60GB + of music. Until [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I have tried a number of different solutions for getting my iTunes library on my remote machine(s). Within my local network iTunes takes just a few seconds using Zeroconf / BonjourÂ technology to find my library and then a few more seconds to load the XML file containing the definitions my 60GB + of music. Until now the easiest and most reliable method I have found is to run Hamachi on my main mac as well as on my laptop(s). Hamachi if you aren&#8217;t familiar simply creates adhoc vpn networks. This works pretty well and it can be used for a number of things. One of which is allowing my iTunes clients to see each other and share libraries. However&#8230;.since OSX 10.5 Leopard Hamachi had (has) been having issues. Sucking up all kinds of memory/crashing, etc&#8230;. That led me to my discovery today. I was actually working to find a way to push dns-sd commands to my .mac account using back to my mac. While doing some googling I ran into this: <a href="http://www.macosxhints.com/article.php?story=20080419233314333">Reach local iTunes library over the net</a>Â which basically outlines nearly exact what I was trying to do.Â  Now I have to execute 2 simple commands which I&#8217;ve saved and then enter my password and within 15-20 secs it loads up my big XML file and almost instantly I have all of my music at my finger tips&#8230;On my connection here where I am currently working I can switch songs and it takes less than 1 second. I was expecting some additional lag when running the data through an SSH pipe. If you have any questions or don&#8217;t understand a word of what you just read you can either ask questions in the comments or move along to the next post <img src='http://www.smallegan.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Also&#8230;if anyone has any ideas on how I can get that XML file to cache and then update every few days or when I manually delete it that would be cool. I have been thinking that with my 3G card in my carputer this may be a viable solution for always having the latest music on my home machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2008/06/23/itunes-library-on-the-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s a war room?</title>
		<link>http://www.smallegan.com/blog/2007/10/03/whats-war-room/</link>
		<comments>http://www.smallegan.com/blog/2007/10/03/whats-war-room/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 17:07:15 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=109</guid>
		<description><![CDATA[
I&#8217;ve had alot of people asking me what a war room is. See the expression on those faces&#8230;. THAT my friends, is a software project war room.
]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://farm2.static.flickr.com/1171/1448018891_9cb5d082ee.jpg?v=1190912447"/></p>
<p>I&#8217;ve had alot of people asking me what a war room is. See the expression on those faces&#8230;. THAT my friends, is a software project war room.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2007/10/03/whats-war-room/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OWL Computing Inc.</title>
		<link>http://www.smallegan.com/blog/2007/09/24/owl-computing-inc/</link>
		<comments>http://www.smallegan.com/blog/2007/09/24/owl-computing-inc/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 13:56:57 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[OWL]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=107</guid>
		<description><![CDATA[It&#8217;s official! I am working with a couple of others on a startup that will be offering small business and residental computer repair (and potentially sales) in the Grand Rapids area. I will be documenting alot of the process of our start-up here so stay tuned. For now here is a glimpse of the logos [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It&#8217;s <a href="http://www.dleg.state.mi.us/bcs_corp/dt_corp.asp?id_nbr=01114T&#038;name_entity=OWL%20COMPUTING,%20INC.">official</a>! I am working with a couple of others on a startup that will be offering small business and residental computer repair (and potentially sales) in the Grand Rapids area. I will be documenting alot of the process of our start-up here so stay tuned. For now here is a glimpse of the logos (Both black and white and color)</p>
<p><img src="/blog/images/owl_logos_lowres.jpg"/></p>
<p>The B&#038;W one will be used most often.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2007/09/24/owl-computing-inc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A big shout out to Bluehost</title>
		<link>http://www.smallegan.com/blog/2007/08/06/a-big-shout-out-to-bluehost/</link>
		<comments>http://www.smallegan.com/blog/2007/08/06/a-big-shout-out-to-bluehost/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 17:46:11 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=95</guid>
		<description><![CDATA[Thank you Bluehost for the wonderful years of service you have given me thus far. I can&#8217;t count the number of times that besides hosting my site, I have hosted a file I needed to share with someone up on this server and have never been disappointed by the level of service that I have [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Thank you Bluehost for the wonderful years of service you have given me thus far. I can&#8217;t count the number of times that besides hosting my site, I have hosted a file I needed to share with someone up on this server and have never been disappointed by the level of service that I have received. It is both a wonder and a godsend that you can keep costs so low while keeping service top notch.</p>
<p>&nbsp;</p>
<p>So I just wanted to say THANKS!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2007/08/06/a-big-shout-out-to-bluehost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In the last couple of months I&#8230;</title>
		<link>http://www.smallegan.com/blog/2007/08/06/in-the-last-couple-of-months-i/</link>
		<comments>http://www.smallegan.com/blog/2007/08/06/in-the-last-couple-of-months-i/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 12:53:43 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=93</guid>
		<description><![CDATA[
Got Married in Jamaica!!!!!!!
Had a reception back home
Landed 3 new projects
Made a move out to Quixtar for my daytime contract
Got a new 60&#8243; 1080p SXRD TV
Got an iPhone!!!!!
Got a hackable little Nokia 770

So no I haven&#8217;t really fallen off the face of the earth&#8230;I&#8217;ve just been doing instead of talking about doing! That and every [...]]]></description>
			<content:encoded><![CDATA[<p></p><ul>
<li>Got Married in Jamaica!!!!!!!</li>
<li>Had a reception back home</li>
<li>Landed 3 new projects</li>
<li>Made a move out to Quixtar for my daytime contract</li>
<li>Got a new 60&#8243; 1080p SXRD TV</li>
<li>Got an iPhone!!!!!</li>
<li>Got a hackable little Nokia 770</li>
</ul>
<p>So no I haven&#8217;t really fallen off the face of the earth&#8230;I&#8217;ve just been doing instead of talking about doing! That and every available minute I have been spending in the pool. Oh man are we having a nice summer!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2007/08/06/in-the-last-couple-of-months-i/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Software Developer Traits</title>
		<link>http://www.smallegan.com/blog/2007/05/01/software-developer-traits/</link>
		<comments>http://www.smallegan.com/blog/2007/05/01/software-developer-traits/#comments</comments>
		<pubDate>Wed, 02 May 2007 01:15:46 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=90</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of talking to&#160;some peers&#160;recently about what it takes to&#160;be a developer&#160;as well as what it takes to stay at the top of your game. I will reiterate that I am talking about developers or &#8220;software engineers&#8221; rather than programmers or &#8220;script kiddies&#8221; who&#160;program for fun but either cannot or choose [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve been doing a lot of talking to&nbsp;some peers&nbsp;recently about what it takes to&nbsp;be a developer&nbsp;as well as what it takes to stay at the top of your game. I will reiterate that I am talking about developers or &#8220;software engineers&#8221; rather than programmers or &#8220;script kiddies&#8221; who&nbsp;program for fun but either cannot or choose not to make it their fulltime profession. </p>
<p>I hope to get some intelligent discussion going on here about this. My intent is to offer suggestions in my next series of posts about what I believe it takes and maybe I am off base and I would love it if you could steer me in the right direction. My opinions come strictly from my experiences in the industry.&nbsp; At this point in time I haven&#8217;t had much exposure (blogs aside) to the professional development world outside of Michigan. I would like to think that are some core qualities that every developer possess, however I am sure this varies based on the industries and regional areas that the developer resides in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2007/05/01/software-developer-traits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something new&#8230;</title>
		<link>http://www.smallegan.com/blog/2007/04/02/something-new/</link>
		<comments>http://www.smallegan.com/blog/2007/04/02/something-new/#comments</comments>
		<pubDate>Mon, 02 Apr 2007 17:07:43 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=68</guid>
		<description><![CDATA[April 9th begins a new chapter in my life.Â  Things are changing rapidly and I am ready. Check back then for a look at what is coming.
]]></description>
			<content:encoded><![CDATA[<p></p><p>April 9th begins a new chapter in my life.Â  Things are changing rapidly and I am ready. Check back then for a look at what is coming.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2007/04/02/something-new/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How much is your blog worth?</title>
		<link>http://www.smallegan.com/blog/2005/11/07/how-much-is-your-blog-worth/</link>
		<comments>http://www.smallegan.com/blog/2005/11/07/how-much-is-your-blog-worth/#comments</comments>
		<pubDate>Mon, 07 Nov 2005 15:16:19 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=37</guid>
		<description><![CDATA[
 		My blog is worth $3,387.24.How much is your blog worth?


]]></description>
			<content:encoded><![CDATA[<p></p><div style="border: 1px solid #cccccc; background-color: white; width: 115px; text-align: center; padding: 0 0 10px 0;">
<p style="margin: 0"><img src="http://static.flickr.com/23/25822676_789bf55448_t.jpg" style="border:0;"/><br /> 		<span style="font-size: 11px;">My <a href="http://smallegan.com/">blog</a> is worth <b>$3,387.24</b>.</span><br /><span style="font-size: 10px;"><a href="http://www.business-opportunities.biz/projects/how-much-is-your-blog-worth/">How much is your blog worth?</a></span></p>
<p><a href="http://www.technorati.com/" style="border: 0px;"><img src="http://technorati.com/pix/tech-logo-embed.gif" style="border: 0px;"/></a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2005/11/07/how-much-is-your-blog-worth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://static.flickr.com/23/25822676_789bf55448_t.jpg" length="4549" type="image/jpeg" />
<enclosure url="http://technorati.com/pix/tech-logo-embed.gif" length="" type="image/gif" />
		</item>
		<item>
		<title>DNS Based Service Discovery (DNSSD)</title>
		<link>http://www.smallegan.com/blog/2005/06/09/dns-based-service-discovery-dnssd/</link>
		<comments>http://www.smallegan.com/blog/2005/06/09/dns-based-service-discovery-dnssd/#comments</comments>
		<pubDate>Fri, 10 Jun 2005 01:22:53 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.smallegan.com/blog/?p=28</guid>
		<description><![CDATA[So lately I have been doing a lot of research into DNSSD. Here are my findings including but not limited to an explanation of what DNSSD is, how it can be used in .NET development with code samples, and a list of external resources.]]></description>
			<content:encoded><![CDATA[<p></p><p>So lately I have been doing a lot of research into DNSSD. Here are my findings including but not limited to an explanation of what DNSSD is, how it can be used in .NET development with code samples, and a list of external resources. <span id="more-28"></span></p>
<p><b>What is DNSSD?</b><br />
In the simplest terms DNSSD is a method of service discovery that is based upon one of the most well known and widely used lookup protocols.  DNSSD is robust enough that if setup properly it could have a use on the internet. However I am only going to be discussing LAN usage where DNSSD truly shines.</p>
<p><b>Zeroconf</b><br />
DNSSD is most widely known as one of the major components of Zeroconf networking. Zeroconf networking is a set of technologies that allow two or more computers to communicate with each other without any external configuration. Zeroconf is a whole different topic though that hopefully we can cover later. If you would like more information about Zeroconf check out <a href="http://www.zeroconf.org">http://www.zeroconf.org</a>. It isn&#8217;t the most exciting read but it is all there!</p>
<p><b>Why use DNSSD?</b><br />
Service Discovery is an interesting problem that usually goes something like this. You have an application that is capable of communicating P2P(Chat, File Sharing, Printer Sharing, Distributed Computing). It is a non-standard application (possibly only for your own personal or corporate use) so you don&#8217;t want or need to get a TCP port set aside. A number of machines are going to be running this application and there is a need to dynamically discover which machines these are and on what port they are expecting to communicate with their peers.</p>
<p>The first thought that generally comes to mind is to set aside one machine to act as a registration server that all of the peers running the application occasionally ping to inform the server that they are online. Although this method works very well in many instances it turns a decentralized p2p system into a semi-centralized p2p system. Meaning that if the &#8220;server&#8221; went offline the P2P &#8220;sessions&#8221; currently in progress would continue to work however no new &#8220;sessions&#8221; could be initiated without the help of the registration server.</p>
<p>DNSSD with the help of multicast DNS is able to clear up this issue. As defined on multicastdns.org &#8220;Multicast DNS is a way of using familiar DNS programming interfaces, packet formats and operating semantics, in a small network where no conventional DNS server has been installed.&#8221; DNSSD is not dependant on the multicast DNS technology, meaning service discovery with DNSSD can be done with a traditional DNS server setup however we must use the multicast DNS technology in order to eliminate the need for a DNS server in our quest for decentralization.</p>
<p><b>How do you implement DNSSD?</b><br />
Although DNSSD is not just an Apple technology it is well known that Apple is the largest advocate and implementer of DNSSD and Zeroconf technology. For this reason Apple is the single greatest resource for DNSSD development.</p>
<p><b>Apple&#8217;s Bonjour</b><br />
Bonjour is a Apple&#8217;s answer to Zeroconf management. It provides a framework for using DNSSD and it is where I have done most of my experimentation with DNSSD. Bonjour offers a version for Windows as well as a Windows SDK.</p>
<p><b>Example #1</b><br />
The first example that I am going to give shows how to use the console application that you can find at c:\program files\bonjour sdk\samples\c\dns-sd.exe once you install the Bonjour SDK for Windows.</p>
<p>Execute the following commands as shown below in a dos prompt.</p>
<p> <a href="http://www.smallegan.com/blog/images/dnssd/ss1.jpg"><img width="400" src="http://www.smallegan.com/blog/images/dnssd/ss1.jpg"/><br />click for larger view</a></p>
<p>Keep your command prompt open. Now if you have iTunes on another machine on the same LAN open it up and check your preferences to see if you have look for shared music checked. If so then you should see a shared library titled &#8220;test&#8221; in your left menu.  That&#8217;s rightâ€¦.iTunes being an Apple product is probably one of the most highly exposed practical applications of DNSSD.</p>
<p>To watch the magic happen in real time you can create and drop this registration by doing the following:</p>
<p>Return to the previously used command prompt window. You should still see &#8220;Got a reply for test._daap._tcp.local.: Name now registered and active&#8221; as the last line.</p>
<p>Press CTRL+C which will end the program</p>
<p>Your iTunes &#8220;test&#8221; library will disappear almost instantaneously.</p>
<p>Now press the up key on your keyboard to get the last executed command back and press enterâ€¦</p>
<p>Repeat the last few steps until your satisfied!</p>
<p><b>WARNING: </b>I did this quite a few times before I got bored of watch it magically appear and disappear, can be quite addictive <img src='http://www.smallegan.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><b>So what was that all about?</b><br />
That was probably the most simplified example of DNSSD experimentation that I could start off with. I am sure that everyone probably tried to click on the library in iTunes and iTunes was quick to tell them that there is no library available at that location.</p>
<p>In order to dissect what we actually just did lets first take a look at the command that we executed in order to make it all happen.</p>
<p>dns-sd -R test _daap._tcp . 1234</p>
<p><b>dns-sd</b><br />
is of course the program name that we are executing.</p>
<p><b>-R</b><br />
is the switch that we are passing to the program in order to let it know what exactly we are trying to do. A full list of switches is available by simply executing &#8220;dns-sd&#8221; without any parameters. -R in this case stands for register, because we are registering a DNS entry. &#8220;-R&#8221; takes in a command line that is formatted like so:<br />
dns-sd -R &#8220;name&#8221; &#8220;type&#8221; &#8220;domain&#8221; &#8220;port&#8221; ["txt"â€¦]</p>
<p><b>test</b><br />
is the name that we are giving our instance of this particular service we are registering</p>
<p><b>_daap._tcp</b><br />
is the Type of service that we are registering. In our example we are using &#8220;_daap._tcp&#8221; because this is apples reserved name for iTunes sharing. (I believe it stands for Digital Audio Access Protocol).</p>
<p><b>.</b><br />
we pass a period in as the domain in order to simply choose our local machine</p>
<p><b>1234</b><br />
is the port number that I randomly made up for our imaginary iTunes shared library.</p>
<p>It is also important to note that there is an optional TXT parameter that we neglected to pass in this instance. A DNS TXT record can be up to 65535 (0xFFFF) bytes long and it is used in DNSSD to pass additional information about the service that is being offered. An example taken from the DNSSD specifications suggests that printing via the LPR protocol often specifies a short queue name and the TXT parameter is good place for that type of information.</p>
<p><b>So ok I can make a fake library in iTunesâ€¦how is this going to help me?</b><br />
Well when it comes to basic examples the iTunes trick is about as simple as you can get. This next example is going to be more practical and hopefully it will give some ideas as to how you can use this in your own application.</p>
<p><b>Example #2</b><br />
In this example we will cover how to discover services that are being exposed via DNSSD. Using the same dns-sd.exe program we will pass in a -B for browse.</p>
<p>First off you are going to have to go through example one and register a service on your machine. You can modify the service instance name and type if wanted or just leave it the same. For the sake of consistency I am going to leave it the same in this example.</p>
<p>The next thing you need to do is start up another command prompt. This is where you are going to do the browsing and you can do this on either the same machine or from another machine on your network.</p>
<p>Execute the following commands as shown in command window below:</p>
<p> <a href="http://www.smallegan.com/blog/images/dnssd/ss2.jpg"><img width="400" src="http://www.smallegan.com/blog/images/dnssd/ss2.jpg"/><br />click for larger view</a></p>
<p>You should get something similar to the output you are seeing above. However please note that I have my command window set smaller than the output so it is wrapping.</p>
<p>The interesting thing here is that it is showing the broadcasted service from your other command window. If you CTRL+C the window that is broadcasting (the other window), you will notice that on this window a new record will be added and it will look similar to this next shot.</p>
<p> <a href="http://www.smallegan.com/blog/images/dnssd/ss3.jpg"><img width="400" src="http://www.smallegan.com/blog/images/dnssd/ss3.jpg"/><br />click for larger view</a></p>
<p>Notice that the first record was for adding a record so in the A/R column you will see where the record was added and then later removed. Hopefully this is starting to make practical sense by now?</p>
<p><b>Example #3</b><br />
In example three I am going to cover a small application that I wrote that basically wraps around the browse function examined in Example #2. The example is written in C# and although there is a .Net component that is still being worked on I wasn&#8217;t aware of this when I was working on this wrapper code. Hopefully the .Net component will be finished up and deployed soon.<br />
 <code><br />
//The method that handles the click of the start button<br />
private void startButton_Click(object sender, System.EventArgs e)<br />
{<br />
//define a new threadstart<br />
ThreadStart job = new ThreadStart(threadJob);<br />
//define a new thread<br />
Thread = new Thread(job);<br />
//start the thread<br />
thread.Start();<br />
}</p>
<p>//the thread method<br />
private void threadJob()<br />
{<br />
//create a new process object<br />
Process = new Process();<br />
//don't use shell execute<br />
process.StartInfo.UseShellExecute = false;<br />
//we are redirecting the standard output here and then we get it later<br />
process.StartInfo.RedirectStandardOutput = true;<br />
//don't create a console window that pops upâ€¦it is not needed<br />
process.StartInfo.CreateNoWindow = true;<br />
//here is the file that we want to execute<br />
process.StartInfo.FileName = "C:\\Program Files\\Bonjour SDK\\samples\\C\\dns-sd.exe";<br />
//here are the parameters we want to pass it<br />
process.StartInfo.Arguments = "-B _daap._tcp. .";<br />
//here we set the working directory<br />
process.StartInfo.WorkingDirectory = "C:\\Program Files\\Bonjour SDK\\samples\\C";<br />
//go ahead and start the process<br />
process.Start();<br />
//create an instance of stream reader and get the standard output from the process<br />
StreamReader myStreamReader = process.StandardOutput;</p>
<p>//create a blank string for later user<br />
string str = "";<br />
//while the process has not executed run the following<br />
while( !process.HasExited )<br />
//while we can still peak and see something in the outputstream run this<br />
while( myStreamReader.Peek().ToString() != string.Empty )<br />
{<br />
//assign the next line that is read to str<br />
str = myStreamReader.ReadLine();<br />
//if the line starts with a T that means we are dealing with the header<br />
//line that is printed on the console and we don't want to process<br />
if (str.Substring(0,1) != "T")<br />
{<br />
//create an array of strings called x and use a regular expression //to split up the output line by whitespace<br />
string[] x = Regex.Split (str.Trim(), @"\s+");<br />
//if there are 7 items in the array created from split proceed<br />
if (x.Length == 7)<br />
{<br />
//If the second item (index of 1) reads "Add" proceed //otherwise bounce to else<br />
if(x[1] == "Add")<br />
{<br />
//Add the instance to the combo box<br />
comboBox1.Items.Add(x[6]);<br />
}<br />
else<br />
{<br />
//Remove the instance from the combo box<br />
comboBox1.Items.Remove(x[6]);<br />
}</p>
<p>}<br />
}<br />
}<br />
}</p>
<p>//close the process<br />
process.Close();<br />
}<br />
 </code><br />
So basically what the above piece of code does is create a thread the constantly checks the standardoutput of the &#8220;dns-d.exe -B _daap._tcp. .&#8221; command. If it detects output that states that a new instance is added or removed it adds or removes the record from the combo box. This is a very trivial example but with something like this you could have a drop down that allows a user to select another pc that is available to interface with software you have running.</p>
<p><b>IMPORTANT:</b><br />
Since it is in a thread it is possible that you could sleep the thread for any amount of time you desire in order to preserve precious processing power, however I must note that you won&#8217;t even notice that it is checking if you don&#8217;t decide to sleep it.</p>
<p><b>Example #4</b><br />
The last example simply shows how we can do a simple query to find out more information on a particular instance of a service that we discover is available. Once we get the instance name by using the -B switch we are able to use the instance name to find more details by using the -L switch. The following example gives us an example as to how the query and results will look.</p>
<p> <a href="http://www.smallegan.com/blog/images/dnssd/ss4.jpg"><img width="400" src="http://www.smallegan.com/blog/images/dnssd/ss4.jpg"/><br />click for larger view</a></p>
<p>Almost identical to the -B switch except the -L switch wants us to specify an instance name  before the type and domain information. (The instance name is &#8220;test&#8221; in our example. )</p>
<p>Hopfully this information is useful to someone and I would love to know if anyone who reads this will decide to apply this knowledge to a real application. So feel free to contact me via comment!</p>
<p>There are not a whole lot of good resources but the two that I will point you to for more information are the specs for dns-sd and zeroconf:</p>
<p><a href="http://www.dns-sd.org/">http://www.dns-sd.org</a><br />
<a href="http://www.zeroconf.org/">http://www.zeroconf.org</a></p>
<p>If anyone is interested in learning more about ZeroConf  let me know! I am considering writing an article on the topic and knowing that it may be useful to some might be a nice incentive!</p>
<p>Also please contact me with any questions about this article or mistakes it may have in it <img src='http://www.smallegan.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.smallegan.com/blog/2005/06/09/dns-based-service-discovery-dnssd/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
<enclosure url="http://www.smallegan.com/blog/images/dnssd/ss1.jpg" length="20824" type="image/jpeg" />
<enclosure url="http://www.smallegan.com/blog/images/dnssd/ss2.jpg" length="19612" type="image/jpeg" />
<enclosure url="http://www.smallegan.com/blog/images/dnssd/ss3.jpg" length="20821" type="image/jpeg" />
<enclosure url="http://www.smallegan.com/blog/images/dnssd/ss4.jpg" length="19462" type="image/jpeg" />
		</item>
	</channel>
</rss>
