Objective-C Client Reference
Class PIOConnection
Language: Objective-C
A connetion to a multiplayer room.
Here's how to create/join a room and send and receive messages:
Methods | |||
---|---|---|---|
- (void) |
|
||
- (void) |
|
||
- (void) |
|
||
- (void) |
|
||
- (BOOL) |
|
||
- (void) |
|
addDisconnectCallback:
Add a disconnect listener to this connection.
Arguments
void(^)(void) | callback |
addMessageCallback:
Add a message listener to this connection. The callback will be called on every message received by the connection.
Arguments
void(^)(PIOMessage*message) | callback |
addMessageCallback:forType:
Add a message listener for a specific message type to this connection.
Arguments
void(^)(PIOMessage*message) | callback |
NSString* | type |
disconnect
Disconnect from the game room
isConnected
Is the connection currently connected to a remote host?
Return Value
BOOL | |
sendMessage:
Send a message to the room.
Arguments
PIOMessage* | message |