bonjour 在 IOS 上如何运行?
我使用 bonjour 创建了一个应用程序,并且能够将文件从一台设备发送到另一台设备。但问题是:如果不在设备上运行这两个应用程序,我就无法发现 LAN 上的设备。我是否需要使用 bonjour 运行应用程序才能使用 bonjour 检测到它。
I created an application using bonjour and I am able to send files from one device to another. But the question is: I am not able to discover the devices on the LAN without running both the applications on the device. Do I need to run the application using bonjour to get it detected using bonjour.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你知道。运行应用程序会将适当的条目注册到 iOS 多播 DNS 服务中。一旦你关闭应用程序,我希望它会从多播 DNS 注册表中删除自身(这样做是正确的,因为它不再可用),因此你无法从其他设备找到它。
编辑:(非常粗略地)Bonjour 是多播 DNS。 Bonjour 服务运行多播 DNS 服务器。当您的应用程序启动时,它会与本地多播 DNS 服务器进行通信,并创建许多条目来标识其提供的服务、可用的端口以及其他相关属性。它还将自己注册为有兴趣了解正在运行该服务的任何其他网络设备。
本地多播 DNS 服务器发出公告,向网络上侦听的任何其他服务器发出信号,表明有新服务可用。 Bonjour 服务会通知您的应用程序(在另一台计算机上)另一个客户端已出现,这或多或少就是神奇的实现方式。更长的多播 DNS 文章随处可见:Google 是您的朋友。
Yes you do. Running the application registers the appropriate entries into the iOS multicast DNS service. Once you shut the app down I expect it removes itself from the multicast DNS registry (which it is correct to do, because it is no longer available), so you can't find it from other devices.
EDIT: (Very roughly) Bonjour is multicast DNS. The Bonjour service runs a multicast DNS server. When your application starts up it communicates with the local multicast DNS server and creates a number of entries that identify the service it is making available, the ports it is available on and other relevant attributes. It also registers itself as interested in learning about any other network device that is running the service.
The local multicast DNS server makes announcements that signal to any one else listening on the network that a new service is available. Your app (on a different machine) is notified by the Bonjour service that another client has appeared, and that is more or less how the magic is done. Longer multicast DNS writeups are all around: Google is your friend.