Windows 上的 Bonjour/DNS-SD
我目前正在开发一个跨平台应用程序(Win/OSX/iOS),它有一个 C++(带有 Boost)后端。在 iOS 和 OSX 上,我使用 Cocoa Net Service 浏览器代理功能通过 mDNS 发现嵌入式设备,然后将信息传递到后端以创建与其通信所需的对象。
我想对我的 Windows MFC 前端采取类似的方法,我发现 这篇文章似乎正是我想要的。然而,使用 Bonjour SDK 似乎有一些非常讨厌的副作用 - 迫使您静态链接到 MFC,在我的例子中,我可以让它正确链接的唯一方法是根本不使用调试 DLL,这并不理想。
所以,Bonjour SDK 对我来说实际上没有任何好处,因为它对我的项目施加了太多限制。对于 Cocoa,我实际上只使用了很少的功能 - 只是 didFindService 和 netServiceDidResolveAddress 。我想做的就是找到给定类型的设备并获取它们的 IP 地址。
任何人都可以建议另一种方法来解决这个问题,该方法可以在 Windows 上与 MFC 前端一起使用吗?
I'm currently working on a cross-platform application (Win/OSX/iOS) which has a C++ (with Boost) back end. On iOS and OSX I'm using the Cocoa Net Service Browser Delegate functions to discover an embedded device via mDNS, then pass the information to the back end to create the objects it needs to communicate with it.
I wanted to take a similar approach with my Windows MFC front end and I found this article which seemed to do exactly what I want. However, it seems that using the Bonjour SDK has some really nasty side effects - forcing you to static link to MFC and in my case the only way I can get it to link properly is to not use debug DLLs at all, which is not ideal.
So, the Bonjour SDK isn't really any good for me because it imposes too many restrictions on my project. With Cocoa I'm actually using very little of the functionality - just didFindService and netServiceDidResolveAddress really. All I want to do is find the devices of a given type and get their IP addresses.
Can anyone suggest another way around this that will work with an MFC front end on Windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我从研究这个主题中收集到的信息,只需转到 http:// www.opensource.apple.com/source/mDNSResponder/mDNSResponder-333.10/ 并获取源代码。有一个 VC 项目文件可以让你按照你想要的方式构建 dll。
From what I have been able to gather from researching this topic just goto http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-333.10/ and grab the source. There is a VC project file which will let you build the dll how you want.