开发者

Advertise service with Bonjour on Windows

I'm developping a remote control on iPhone for Mac OS and Windows. I use Bonjour framework and it's working well on Mac OS. I can see on my iPhone the different Mac devices which have my server.

I would like to do the same thing on Windows with language C or C#. I haver wrote a piece of code it does'nt work : my iPhone does'nt see the service. Here's a line of code that can be wrong I think :


if(DNSServiceRegister(&se开发者_运维百科rvice, 0, 0, HostName, "_esiearemote._tcp.", "", NULL,htonl(PORT), 0, NULL, reg_reply, NULL)!=kDNSServiceErr_NoError)

Have you got an idea ? Thanks a lot !


Are you compiling it against dnssd.dll?

Have you tried using C:\Windows\system32\dns-sd.exe instead? At least as a debugging tool?

Is mDNSResponder (the Bonjour Service) running? Many people disable it.

Also the problem could be between your PC and the iPhone, check if the service is advertised correctly on your PC, with Safari, the BonjourFoxy Firefox Extension or the Bonjour SDK

I also posted a couple of links to Apple documentation (the dns-sd and dnssd.dll/dylib manpages) in another answer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜