Updated 2015-03-30 12:23:38 by dbohdan

Apple Computer's implementation of the ZeroConf [1] 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:


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 passed 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 in a gui or prompt, you may not want to see something like this:

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 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.