如何使用 Bonjour C 库知道设备何时从网络中删除
我正在使用 DNSServiceDiscovery C 库 Bonjour 来检测相机和打印机。我正在使用 Windows 7 和 Visual 2010。
我能够检测到相机和打印机。 现在我想知道当设备从网络中删除时如何获取通知。
建议我如何实现此功能。
I am using DNSServiceDiscovery C Library Bonjour to detect Camera and Printer.I am Using Windows 7 and Visual 2010.
I am able to detect the Camera and Printer.
Now I am wondering how to Get notification when device is removed from the network.
Suggest me how to implement this feature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您保持 DNSServiceBrowse 操作运行,则当先前找到的服务之一似乎不再存在时,您最终会收到通知。然而,这不是瞬时的事情。请记住,浏览的主要用例是填充用户可以从中选择服务的 UI。
If you keep your DNSServiceBrowse operation running, you will eventually get notified when one of the previously-found services appears to no longer be present. This isn't an instantaneous thing, however. Keep in mind that the primary use case for Browse is to populate a UI from which the user can select a service.
经过彻底研究后,我找不到办法做到这一点。
After researching thoroughly, I can't find a way to do this.
Bonjour Api 无法知道设备何时被移除。
如果设备公开某些服务并且客户端程序与之同步,我们可能可以知道它。我正在为我的应用程序做同样的事情。
There is no way in Bonjour Api to know when the device is removed.
If the device exposes some service and client program is synch up with that, probably we can know about it.I am doing the same for my application.