iPhone networking woes.

Published February 13, 2010
Advertisement
I spent the last 3 days trying to figure out why there was serious packet latency issues. Because wifi and bluetooth share the same antenna, you cannot be sending data over both.

Here's what I've figured out:


  • You do not need to turn off Bluetooth in order to use wifi.

    • I have not verified if you need to do this if you have other bluetooth gadgets communicating with your device. I would assume yes, as they would be interfering with your wifi.

  • You should not create a GKSession if you won't be using Bluetooth, otherwise it seems to eat up Bluetooth resources, therefore causing problems even if it is not connected to another iPod/iPhone.


So this presents a dilemma when it comes time for the user to decide how to host or connect to another game! I will likely do something like this:

Hosting:

  • [ Local Game ]

    • Visible on bluetooth only. Doesn't advertise on the lobby or respond to LAN broadcasts.

  • [ WiFi/3G game ]

    • Visible on LAN and 3G (I don't have an iPhone to test this with yet).



Join game:

  • [ Local game ]

    • Starts a GKSession and picker, looking for servers.

  • [ Internet game ]

    • LAN broadcasts, lobby server, etc.



It's probably less user-friendly, but should have better performance overall.

The above 4 options are one more than my current UI is using, which includes a one-click host game button which starts a GKSession and uses sockets. Obviously I have to fix that now.

So, what's the disadvantage here? Mostly just having really diverse connection options, like Laptop (( wifi )) iPhone 1 (( Bluetooth )) iPhone 2
Previous Entry Untitled
Next Entry VRTank released!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement