shiami
shiami

Reputation: 7264

Both as a client and a server with GKSession

Can I implement two GKSession, one as a client and the other as a server at the same time? Is there a problem or any limitation to implement this connection with WiFi and Bluetooth? Thanks!

Upvotes: 0

Views: 324

Answers (2)

shiami
shiami

Reputation: 7264

GKSessionModePeer seems only can connect to another peer. But I need to build up more complex network structure. So I finally created two different sessions for both GKSessionModeServer and GKSessionModeClient. And it can exist at the same time.

Upvotes: 0

killdash10
killdash10

Reputation: 716

You can do this using GKSessionModePeer:

    gkSession = [[GKSession alloc] initWithSessionID:nil displayName:nil sessionMode:GKSessionModePeer];

In peer mode, you act both as a client and as a server for other devices.

Upvotes: 1

Related Questions