iOS Bonjour 设备连接限制?
如果我通过 Bonjour(而不是 GameKit 的实现)编写自己的网络服务,可以连接到单个套接字的设备数量是否有限制?意思是,我有一台设备作为“主机”,通过蓝牙/Wi-fi 连接到主机的其他设备数量是否有限制?
If I am writing my own networking services via Bonjour (instead of GameKit's implementation), is there any limit to the amount of devices that can connect to a single socket? Meaning, I have one device that is the "host", is there a limit to how many other devices can connect to the host via Bluetooth/Wi-fi?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
能够连接到给定主机的远程用户的最大数量由 iOS 允许您在套接字上打开的文件描述符的最大数量决定。严格来说这不是 Bonjour 问题。我无法找到 iOS 的任何文档,但 OS X 的默认值目前约为每个套接字 256 个打开描述符(与其他 UNIX 相比较低,尽管它很容易被修改)。
考虑到 iOS 设备的硬件限制,我假设这个最大值较低,但仍应为数百,对于同一链接本地网络上的用户之间的游戏来说足够舒适。
当并发玩家数量超过该数量时,CPU 和网络条件很可能成为限制因素。
The maximum number of remote users able to connect to the given host is dictated by the max number of file descriptors iOS allows you to open on a socket. It's not strictly a Bonjour issue. I'm unable to find any documentation for iOS but the default value for OS X is presently around 256 open descriptors per socket (low compared to other UNIXes, although it can easily be bumped).
Given the hardware constraints of an iOS device I would assume this max value is lower, but should still be in the hundreds, comfortably enough for gameplay between users on the same link-local network.
Get above that number of concurrent players and the likelihood is that CPU and network conditions would be the limiting factor anyway.