开发者

How to advertise a Bonjour Service in Visual C++

I'm trying to figure out if t开发者_运维技巧his is even possible, but what's the simplest way of advertising a Bonjour service through Visual C++?


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/


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜