Note that there are some explanatory texts on larger screens.

plurals
  1. POGameKit: What is the connection type when using GKSession without GKPeerPickerController
    primarykey
    data
    text
    <p>I am implementing a <code>BlueTooth</code> and <code>Wifi</code> Based chat program for <code>iPhone</code>. For connection purpose I am using <code>GameKit</code>. But because of some special requirements application I can't use the default <code>GKPeerPickerController</code>. So I instead I created a <code>GKSession</code> and <code>GKSessionDelegate</code> combo to detect the peers. After they find each other, they can chat.</p> <p>Now I have tested the chat functionality on three <code>mac-minis</code> using <code>simulator</code>, one simulator and one <code>iPod</code>, one <code>iPhone</code> and one <code>Simulator</code>. I am able to chat in all of the above scenarios. But some how the <code>iPhone</code> and <code>iPod</code> won't detect each other.</p> <p>Also I am curious about type of connection is happening between all these devices. Because theoretically <code>GameKit</code> supports both, <code>BlueTooth</code> and <code>WiFi</code>. Now the problem is that <code>GKPeerPickerController</code> let's one choose specifically between <code>BlueTooth</code> and <code>WiFi</code>, (unfortunately the implementation of <code>WiFi</code> is not documented anywhere.) This is fine, but what about the custom scenario when one implements his or her own <code>GKSession</code> and <code>GKSessionDelegate</code> Combo. When one creates <code>GKSession</code> Object using the only <code>init</code> method available: </p> <pre><code>– initWithSessionID:displayName:sessionMode: </code></pre> <p>only configuration option this provides is <code>sessionMode</code> but it has only three options </p> <pre><code> GKSessionModeServer, GKSessionModeClient, GKSessionModePeer, </code></pre> <p>None of which indicates connection choice between <code>Bluetooth</code> and <code>WiFi</code>. </p> <p>But I have disabled <code>bluetooth</code> on the <code>iPod</code> and tested it with a <code>mac-mini</code> it works so I guess this is using <code>WiFi</code>. Also in the log I get following line:</p> <pre><code>DNSServiceRegister callback: Ref=4c3f3d0, Flags=2, ErrorType=0 name=00XGT0H0A..BTChat1 regtype=_0eilkgh5o2mq17._udp. domain=local. </code></pre> <p>The <code>DNSServiceRegister</code> and <code>udp</code> part make me think the communication is happening over <code>TCP/IP</code>. </p> <p>So does this mean that when I start with <code>GKSession</code> and <code>GKSessionDelegate</code> the default method of communication is WiFi only, or does it support <code>WiFi</code> and <code>bluetooth</code> both at the same time (though I never got a single indication that <code>BlueTooth</code> connection was happening). </p> <p>But <code>GameKit</code> is supposed to be mainly about <code>BlueTooth</code> Right? Can anybody put light on the situation about what exactly is happening?</p> <p>Also have you seen any sample code where somebody has implemented WiFi interface for <code>GKPeerPickerController</code>?</p> <hr> <p><strong>Solved:</strong></p> <p>OK Found it myself. <code>GKSession</code> and <code>GKSessionDelegate</code> custom implementations as I have mentioned in the question works for both <code>bluetooth</code> and <code>WiFi</code>. Actually the <code>iPhone (JailBroked)</code> I am using had some issues with <code>BlueTooth</code> and possibly that was preventing <code>Gamekit</code> to Work Properly, After hard resetting the phone and turning <code>Airplane</code> mode on off , <code>bluetooth</code> on off a few times got the <code>bluetooth</code> working on the phone. Now the app is working fine in both <code>WiFi</code> and <code>BlueTooth</code> mode.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload