How to advertise a Bonjour Service in Visual C++
Asked Answered
C

2

6

I'm trying to figure out if this is even possible, but what's the simplest way of advertising a Bonjour service through Visual C++?

Conditioning answered 11/8, 2010 at 22:3 Comment(0)
M
7

You can use the DNS Service Discovery client: dns-sd.

Windows Bonjour Installer puts it in C:\Windows\system32\dns-sd.exe

Its synopsis is:

 dns-sd -R name type domain port [key=value ...]

 dns-sd -B type domain

 dns-sd -L name type domain

There isn't any easy way to find indepth Bonjour windows documentation, (and it's a serious shame) but here's the manpage for its mac equivalent:
http://developer.apple.com/.../dns-sd.1.html

There is also C:\Windows\system32\dnssd.dll whose API, I unfortunately have to suppose, conforms to this document:
http://developer.apple.com/.../dns_sd_h/

Mara answered 21/10, 2010 at 14:44 Comment(1)
Update: one atrocious detail from documentation: «The dns-sd command is primarily intended for interactive use. Because its command-line arguments and output format are subject to change, invoking it from a shell script will generally be fragile »Mara
S
0

This is rather old question... however as I had recently implemented Bonjour functionality in Windows for one project, have some insight into it. There is a Bonjour SDK for Windows from Apple developer site with examples in C, C#, etc. In C examples folder there is a complete source for dns-sd client which you can then use to build your own client (for registering services, names, etc.). As that is C, you can then easily pack this functionality as dll and then allow and other languages to use it (for example, C#).

Bonjour SDK for Windows @ developer.apple.com

Sianna answered 12/12, 2016 at 14:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.