Version 10 of Bonjour

Updated 2011-03-11 15:49:11 by Lordmundi

Apple Computer's implementation of the ZeroConf [L1 ] network configuration and service discovery protocol, formerly known as Rendezvous.

A Tcl package for Bonjour is available at http://github.com/dongola7/tcl_bonjour/ .


lordmundi: This is a great package. I think many people may be missing it since they are searching for things like "DNS-SD" or DNS Service Discovery, or mDNS. To help out these keyword based google searches, this package will let you do DNS service discovery browsing, publishing, and resolving in tcl. If you aren't familiar with DNS-SD, you can learn more about it here:

http://en.wikipedia.org/wiki/Zero_configuration_networking


lordmundi (2011-03-11): As a hint for anyone using the package - the returned service name when doing a resolve has escaped characters so that it can be pased into other functions of the bonjour api directly. However, if you are like me and want to give the service name back to the user on a gui or in a prompt, you may not want to see something like this:

 kramer\032\09100\05826\05818\058fc\0588f\05809\093._workstation._tcp.local.

the solution is to run it through a quick function to make the name more readable, (although you may want to hang on to the encoded string also). A great discussion on [http://wiki.tcl.tk/6203|this page] yielded this nice function:

 proc get_printable_name { encoded_name } { 
     return [ subst [ regsub -all {\\([0-9]{3})} $encoded_name {[format %c [scan "\1" %d]]} ] ]
 }

which would give you:

 % get_printable_name {kramer\032\09100\05826\05818\058fc\0588f\05809\093._workstation._tcp.local.}
 kramer [00:26:18:fc:8f:09]._workstation._tcp.local.

Hope that helps someone.