Android Client Reference
Class Connection
Namespace: com.playerio
Language: Java
A connection into a running Player.IO multiplayer room.
Here is an example of joining a multiplayer room and listening to all messages:
Methods | |||
---|---|---|---|
public void |
Add a disconnect listener to this connection. |
||
public void |
Add a message listener to this connection. |
||
public void |
Disconnect from the game room |
||
public boolean |
Is the connection currently connected to a remote host? |
||
public void |
Send a message to the connected client without first having to construct a Message object. |
||
public void |
Send a message to the room |
Connection.addDisconnectListener
public void |
|
Add a disconnect listener to this connection.
Arguments
DisconnectListener | listener |
Connection.addMessageListener
public void |
|
Add a message listener to this connection.
Arguments
String | type |
MessageListener | listener |
Connection.disconnect
public void |
|
Disconnect from the game room
Connection.isConnected
public boolean |
|
Is the connection currently connected to a remote host?
Connection.send
public void |
|
Send a message to the connected client without first having to construct a Message object.
Arguments
String | type |
Object... | parameters |
Connection.send
public void |
|
Send a message to the room
Arguments
Message | msg |