views:

162

answers:

1

Hello, All:

I'm trying to set up a client-server architecture. I have one GKSession configured as a server, and two others as clients.

When either client uses the sendData:toAllPeers:WithDataMode:error method, it sends it not only to the server but to the other client.

I guess I could use the display name to exclude clients, so client data only goes to the server, but I'm not quite following why this is happening.

My server explicitly accepts a connection, via acceptConnectionFromPeer:error: But my client isn't accepting anything from anybody, it seems to be just silently finding the other client.

Should this be happening? I understand in a peer-peer setup you'd want peers to just find others; but in client-server, this seems a little weird.

Any clarification or advice would be greatly appreciated.

Thanks,

Michael

A: 

While a client cannot explicitly connect to another client, but the method sendData:toPeers:withDataMode:error: should allows you to send data directly from one client to another given that you have the correct peerId.

Ricky Lung