ninjaneer
ninjaneer

Reputation: 7031

GKSession sendDataToAllPeers on client?

My current sessionMode is GKSessionModeServer. If I'm on a client and I do the following:

[mySession sendDataToAllPeers:packet withDataMode:GKSendDataReliable error:nil];

Will that send data to every peer in the server or just to the server itself. Sorry for asking a simple question, but I only have 2 devices to test with.

Upvotes: 2

Views: 811

Answers (1)

Fattie
Fattie

Reputation: 12296

Great question!

Yes, it will send the data to ALL the thingies connected to that server.

BTW if you're just getting started with networking, you may find this useful...

Most effective way to do networking on Mac/iPhone?

And here is an absolutely critical tip regarding gamekit:

Critical tip: Client/Server GKSessions

You have done the right thing by using GKSessionModeServer.

Upvotes: 2

Related Questions