Note that there are some explanatory texts on larger screens.

plurals
  1. POGameKit: GKSession manual
    primarykey
    data
    text
    <p>I want to connect two devices using the GKSession, starting one as a server and the other one as a client. Using this configuration I can't use the GKPeerPickerController.</p> <p>I'm having problems for connecting the two devices:</p> <ul> <li>Using only bluetooth: impossible</li> <li>using WiFi: at least there are some data exchange between the devices but no successfully conection.</li> </ul> <p>In the interface file I have the </p> <pre><code>GKSessionDelegate GKSession *session; </code></pre> <p>In the implementation, I start the server using this code:</p> <pre><code>session = [[GKSession alloc] initWithSessionID:@"iFood" displayName:nil sessionMode:GKSessionModeClient]; session.delegate = self; session.available = YES; </code></pre> <p>The client starts using this code:</p> <pre><code>session = [[GKSession alloc] initWithSessionID:@"iFood" displayName:nil sessionMode:GKSessionModeServer]; session.delegate = self; session.available = YES; </code></pre> <p>How I can force the use of Bluetooth instead of the WiFi ?</p> <p>Also I have implemented those calls:</p> <pre><code>-(void)session:(GKSession *)session didReceiveConnectionRequestFromPeer:(NSString *)peerID { NSLog(@"Someone is trying to connect"); } - (BOOL)acceptConnectionFromPeer:(NSString *)peerID error:(NSError **)error { NSLog(@"acceptConnectionFromPeer"); } </code></pre> <p>When I start, I get this into the debugger:</p> <pre><code>Listening on port 50775 2010-02-19 14:55:02.547 iFood[3009:5103] handleEvents started (2) </code></pre> <p>And when the other device starts to find, I get this:</p> <pre><code>~ DNSServiceBrowse callback: Ref=187f70, Flags=2, IFIndex=2 (name=[en0]), ErrorType=0 name=00eGs1R1A..Only by Audi regtype=_2c3mugr67ej6j7._udp. domain=local. ~ DNSServiceQueryRecord callback: Ref=17bd40, Flags=2, IFIndex=2 (name=[en0]), ErrorType=0 fullname=00eGs1R1A\.\.Only\032by\032Audi._2c3mugr67ej6j7._udp.local. rrtype=16 rrclass=1 rdlen=18 ttl=4500 ** peer 1527211048: oldbusy=0, newbusy=0 ~ DNSServiceBrowse callback: Ref=187f70, Flags=2, IFIndex=-3 (name=[]), ErrorType=0 name=00eGs1R1A..Only by Audi regtype=_2c3mugr67ej6j7._udp. domain=local. GKPeer[186960] 1527211048 service count old=1 new=2 ~ DNSServiceQueryRecord callback: Ref=17bd40, Flags=2, IFIndex=-3 (name=[]), ErrorType=0 fullname=00egs1r1a\.\.only\032by\032audi._2c3mugr67ej6j7._udp.local. rrtype=16 rrclass=1 rdlen=18 ttl=7200 ** peer 1527211048: oldbusy=0, newbusy=0 ~ DNSServiceBrowse callback: Ref=187f70, Flags=2, IFIndex=-3 (name=[]), ErrorType=0 name=00TF5kc1A..Only by Audi regtype=_2c3mugr67ej6j7._udp. domain=local. ~ DNSServiceQueryRecord callback: Ref=188320, Flags=2, IFIndex=-3 (name=[]), ErrorType=0 fullname=00tf5kc1a\.\.only\032by\032audi._2c3mugr67ej6j7._udp.local. rrtype=16 rrclass=1 rdlen=18 ttl=7200 ** peer 1723356125: oldbusy=0, newbusy=0 ~ DNSServiceQueryRecord callback: Ref=188320, Flags=2, IFIndex=2 (name=[en0]), ErrorType=0 fullname=00TF5kc1A\.\.Only\032by\032Audi._2c3mugr67ej6j7._udp.local. rrtype=16 rrclass=1 rdlen=18 ttl=4500 ** peer 1723356125: oldbusy=0, newbusy=0 </code></pre> <p>What I'm missing here ?</p> <p>I'm sure that both devices have bluetooth enabled and connected into the same WiFi.</p> <p>thanks,</p> <p>r.</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