title: Bluetooth multiplayer game lag issue
body: <p>I am developing a 3D bluetooth multiplayer game for iPhone and iPad without using any game engine. I am using GKSession class to send data between devices over Bluetooth using Peer to Peer mode. If I continue to play the game for some time there is no performance drop issue, but when I disconnect (even without exiting the game) and reconnect the game again via Bluetooth game mode, then I am facing the performance drop (game lag) issue.</p>
  
  <p>I tried profiling my code (when the game lags) and found that the data packets require more time (approx. 10 ms) to transfer to the other device which usually takes 2 ms when the game runs without lag.</p>
  
  <p>I have three questions:</p>
  
  <ol>
  <li><p>I am assuming that the increase in data transfer time can be the cause for the lag issue. If yes, how to fix such issue?</p></li>
  <li><p>I am testing my game on iPad and iPhone running on iOS 7 and 8 respectively. As GKSession is deprecated with iOS 7, will this affect the game performance?</p></li>
  <li>Are there any other parts of the code which can cause such performance issue?</li>
  </ol>
  
  <p>I’d appreciate any suggestions on this issue. Thank you in advance.</p>
  
  <p>Code snippets: </p>
  
  <p>Code to disconnect two devices</p>
  
  <pre><code>     if(session!=nil)
          {
              [session disconnectFromAllPeers];
              [session setAvailable:NO];
              [session setDataReceiveHandler:NULL withContext:NULL];
              session.delegate = nil;
              [session release];
         } 
  </code></pre>
  
  <ol start="2">
  <li><p>Code to create session</p>
  
  <p>(GKSession *) peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type {</p>
  
  <pre><code>session = [[GKSession alloc] initWithSessionID:@"XYZ" displayName:nil sessionMode:GKSessionModePeer];
  session.delegate = self;
  session.available = YES;
  return session;
  </code></pre>
  
  <p>}</p></li>
  <li><p>Definition of session in header file</p>
  
  <p>@property (nonatomic, retain) GKSession *session;</p></li>
  </ol>