GameKit (GKSession) : 当 GKSession 决定使用 Wifi 或蓝牙时是否有优先顺序(如果两者都可用)
如果我有两个 iOS 设备,都在同一个 WiFi 网络上并且都打开了蓝牙,并且我使用 GameKit(特别是 GKSession)在它们之间手动设置通信通道(不使用 GKPeerPickerController),我无法判断它是否使用 WiFi 或蓝牙。
iOS 是否优先考虑其中一项?我希望它先使用 Wifi,然后再使用蓝牙,但我想确定一下。
如果 WiFi 可用而蓝牙不可用,则使用 Wifi;如果蓝牙可用而 Wifi 不可用,则使用蓝牙。我想知道如果蓝牙和 WiFi 都可用,他们会如何谈论,GameKit 会选择哪个?
我能找到的唯一方法是在我的 WiFi 上运行数据包嗅探器并在不同设备上运行多个测试。有点希望有人可以节省我的精力!
谢谢 :-)
If I have two iOS devices, both on same WiFi network and both with Bluetooth turned on, and I use GameKit (specifically GKSession) to manually setup a communications channel between them (without using GKPeerPickerController), I cant tell if it is using WiFi or Bluetooth.
Does iOS prioritise one over the other? I'm hoping that it uses Wifi before Bluetooth, but id like to be sure.
If WiFi is available and bluetooth isn't, it uses Wifi, if Bluetooth is available and Wifi isn't, it uses Bluetooth. Im wondering how they're talking if both bluetooth and WiFi are available, which does GameKit choose over the other?
The only way I can see to find this out is by running a packet sniffer on my WiFi and running several tests across different devices. Kinda hoping someone can save me that effort!
Thanks :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 Apple 的文档,如果您使用
GKPeerPickerController
创建您的GKSession
您将能够选择蓝牙或 wifi 连接(请参阅GKPeerPickerConnectionType)。它 似乎互联网连接需要一些用户代码(但不是蓝牙),所以我会猜测它默认为蓝牙以避免强制执行此要求。
According to Apple's documentation if you use a
GKPeerPickerController
to create yourGKSession
you will be able to select bluetooth or wifi connectivity (see GKPeerPickerConnectionType).It seems an internet connections requires a bit of user code (but not bluetooth) so I would guess it defaults to bluetooth to avoid making this requirement mandatory.