I have to implement multiplayer game in which I am doing p2p communication using both bluetooth and WIFI. Specially for iphone 1G I have to do connection via WIFI. but in picker default connection type is bluetooth. So how to set it to WIFI. Can anyone suggest sample codes for WIFI connection. except GKtank. Thanks in advance.
Asked
Active
Viewed 5,738 times
2 Answers
2
Hassan’s answer is wrong.
GameKit’s peer-to-peer model can be used in two ways. The Bluetooth classes (that work with PeerPicker, etc.) basically implement Bonjour over Bluetooth. However, if you want to support Wi-Fi and Bluetooth the best thing to do is have a Bonjour based “framework” for establishing the connections, but feed it either from the standard Bonjour services (for Wi-Fi) or from those established by GameKit over Bluetooth.
This post provides some good pointers, but in essence, you will need to use Bonjour to establish your Wi-Fi peer-to-peer connection.

Community
- 1
- 1

rougeExciter
- 7,435
- 2
- 21
- 17
-
hey thank you very much. can you suggest any links where i'll get sample code for it. – amy Feb 22 '10 at 13:44
0
add the following method in your code
- (void)peerPickerController:(GKPeerPickerController *)picker didSelectConnectionType:(GKPeerPickerConnectionType)type
{
picker.connectionTypesMask = GKPeerPickerConnectionTypeOnline;
}

freelancer
- 1,658
- 1
- 16
- 37