The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Computers Blogs - Blog Top Sites

Site Hits

Total: 2,795,178
since: 19 Jan 2005

What does a WWDC 2007 Attendee do with 1.5 hours of downtime?

posted Thu 14 Jun 07

So I was sitting down in the labs the other day with a few minutes of spare time. I was thinking back to a PDC or some other conference I attended where they were showing off some fantastic new technology in the .NET Framework by creating an Attendee chat program. It basically worked similarly to MSN messenger. You turned the app on and you were suddenly in touch with all the attendees of PDC.

Anyway, I decided to see what something like this might look like in Cocoa. I decided to use Bonjour and Distributed Objects. Using Bonjour was a no-brainer... its fantastic and allows me to broadcast the presence of any service I am hosting to my subnet and optionally beyond.

The app I built basically works like this. You start up the application and it tells the local subnet that a service of type "_wwdc_chat._tcp." is up and running with whatever name the user chose. For example, I started mine up, called myself "Kevin", and the app was then advertising the existence of a service named "Kevin" of type "_wwdc_chat._tcp." on my machine.

The app then sets up a browser for all services of that type. Every time a service is added or removed of that type, my app will be automatically notified. This means that when people come online and go offline, the app gets notified. Pretty slick! To send someone a message, all I have to do is pick them from the dropdown list, resolve the address of the service asynchronously, and when I get the address of the service being hosted by that particular user, I can then use Cocoa's Distributed Objects to send a chat message to that user.

Anyone want to venture a guess as to how long it took this Cocoa newbie to write this app? Including spending 30 minutes figuring out some weird memory management issue that arose from my lack of understanding of the NSNetServiceBrowser class, it took me 1 hour and 31 minutes (I clocked it..).

And to show you that this isn't just some silly toy application, here's a screenshot of me monitoring the multicast DNS entries coming in and out for a given service type:

tags:      

links: digg this    del.icio.us    technorati    reddit




1. Jason left...
Thu 14 Jun 07 7:25 pm

I was hoping you would seed the Developer Preview you got. :(


2. Kevin Hoffman left...
Thu 14 Jun 07 7:28 pm

Hah, I've been running the developer preview of Leopard since 12:30pm on the day of the keynote. I'm loving it.


3. James Gregurich left...
Thu 14 Jun 07 10:14 pm

If you have seen a 6'6", red-headed giant wandering around wwdc, that is me. say hello if you get behind me on the escalator. :)


4. Kevin Hoffman left...
Thu 14 Jun 07 10:29 pm

That's you? I think you stepped on me the other day... :)


5. James Gregurich left...
Thu 14 Jun 07 10:57 pm

my apologies. :)


6. David Orriss Jr left...
Thu 19 Jul 07 5:50 pm :: http://www.codethought.com/blog

Kevin - any chance you might share the code for that app for us who are starting to ramp up on Cocoa development? :-)


7. Kevin Hoffman left...

Keep your eyes peeled to this blog. I will eventually be posting more and more Cocoa code, including a more robust example of the P2P chat app.

Thanks!


Tag Related Posts

Apple drops the iPhone NDA for Released Software

Wed 01 Oct 08 3:54 P GMT-05
tags:          

Cappuccino, Objective-J, and You

Wed 10 Sep 08 6:14 P GMT-05

So I'm in the LA Times ;)

Wed 27 Aug 08 2:51 P GMT-05
tags:                  

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

Building Model Classes in C# and Cocoa

Sun 15 Jun 08 3:13 P GMT-05
tags:            

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

My Macbook Air is masculine, dammit!

Mon 17 Mar 08 6:59 P GMT-05
tags:          

My Macbook Air Review

Sun 02 Mar 08 4:20 P GMT-05

Video of the Macbook Air in Action

Wed 20 Feb 08 3:04 P GMT-05

Leopard Code Sample : Sprinkling in some Bonjour

Tue 27 Nov 07 2:32 P GMT-05
tags:        

Leopard Sample: A Bound NSCollectionView

Mon 29 Oct 07 1:41 A GMT-05

Leopard is out - let the code samples begin!

Fri 26 Oct 07 10:09 A GMT-05
tags:          

My life is complete : iPhone SDK is CONFIRMED.

Wed 17 Oct 07 6:38 P GMT-05
tags:          

Leopard Shipping October 26th!!

Tue 16 Oct 07 4:59 P GMT-05
tags:        

My iPhone Review

Mon 23 Jul 07 1:09 P GMT-05
tags:        

Microsoft Codename Acropolis - Unwrapped

Wed 20 Jun 07 3:22 P GMT-05
tags:              

The dreaded language bleed-over has begun

Tue 19 Jun 07 6:23 P GMT-05
tags:        

Exploring the Delegate Design Pattern

Mon 14 May 07 6:30 P GMT-05

Orcas' Hidden Gem - The managed PNRP stack

Fri 11 May 07 6:45 P GMT-05
tags:        

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05

Exploring the MVC Pattern in WPF

Tue 10 Apr 07 12:51 P GMT-05
tags:                      

An experience with the Leopard beta

Mon 26 Mar 07 7:45 P GMT-05
tags:                

WPF Bindings == WTF Bindings?

Mon 12 Mar 07 6:31 P GMT-05

Objective-C Categories vs C# 3.5 Language Extensions

Mon 26 Feb 07 1:05 P GMT-05
tags:                

Cocoa Programming vs. WPF : NIB vs XAML

Tue 20 Feb 07 2:09 P GMT-05

Cocoa Bindings vs. WPF Binding

Thu 15 Feb 07 5:41 P GMT-05
tags:                

Objective-C 2.0 - Programming for wimps?

Wed 31 Jan 07 6:18 P GMT-05
tags:              

Mac OS X Leopard Developer Preview

Tue 09 Jan 07 1:58 P GMT-05
tags:      

My thoughts on the WWDC '06 Keynote

Thu 10 Aug 06 12:36 P GMT-05
tags:          

Windows Vista Beta 2 - Day 2

Fri 26 May 06 11:50 A GMT-05
tags: