GKSession sendDataToAllPeers including sender?
Posted
by Typeoneerror
on Stack Overflow
See other posts from Stack Overflow
or by Typeoneerror
Published on 2010-06-10T05:10:00Z
Indexed on
2010/06/13
22:42 UTC
Read the original article
Hit count: 337
I've got a number of devices connected over wifi using GameKit. I have a simple UIAlertView
popping up when peers receive data. All but the sendee show this alert view when data is sent, so I'm wondering if that's a bug in my app or if that's expected behavior. If the device doing the sending is also a GKSessionModePeer
, I would expect it to "fire" its receiveData:
message as well since I'm sending to all peers.
Should I call a method manually at the same on the sendee device? For example, if I wanted to send a "GameStart" packet to the 4 phones, the peers would call startGame:
in the receiveData:fromPeer:inSession:context:
method when it receives that packet and the sendee would be calling sendDataToAllPeers:
and call startGame:
on itself.
Does that sound right or is there a way to include the sendee in the sendDataToAllPeers:
list so that it responds exactly the same as all connected peers?
© Stack Overflow or respective owner