Bonjour/ZeroConf and OSC

hi,

I've successfully used the Bonjour API to advertise OSC services of type "_osc._udp".
for more information on Bonjour, zeroconf, dns-sd have a look here:
http://developer.apple.com/networking/bonjour/index.html
http://www.dns-sd.org/
http://www.multicastdns.org/
http://www.zeroconf.org/

you can find an external for max/msp here:
oscbonjour.zip

and the source code is available on sourceforge here:
oscbonjour.cpp

What I have done for now, is to register OSC receivers that clients can connect to, by resolving the IP and port from the service name.

However when using Bonjour for hardware plateforms that don't have contextual menus and advanced configuration interface, one might want to register a service for an OSC emitter, and not a receiver. That's closer to what people are used to when browsing for midi devices, HID interfaces or soundcards.

So the question is how to register both OSC sources and recievers using Bonjour?

1) use different service types?

  • "_oscclient._udp"
  • "_oscserver._udp"

and only use the port when listening to a client

2) use Bonjour optionnal key/value text fields

  • "_osc._udp"
  • servicename
  • port
  • type=client/server
  • another_optionnal_value=the_valuew

any thoughts?

imo it's more flexible to

imo it's more flexible to use key/value fields, because they might be useful for other information regarding the service, e.g. poor man's schema/application type.

what about services that are both client and server? can values be lists of strings?

Agreed

Although one mode typically dominates, many OSC devices will be both transmitters and receivers. Additionally in bi-directional communication the port that response packets are sent to does not need to be fixed (e.g. by using the clients' source port as the destination).

Since OSC does not deal with the transport layer this detail will need to be handled in the Bonjour/ZC setup.