io.socket
Interface IOCallback

All Known Implementing Classes:
IOConnection

public interface IOCallback

The Interface IOCallback. A callback interface to SocketIO


Method Summary
 void on(java.lang.String event, IOAcknowledge ack, java.lang.Object... args)
          On [Event].
 void onConnect()
          On connect.
 void onDisconnect()
          On disconnect.
 void onError(SocketIOException socketIOException)
          On error.
 void onMessage(org.json.JSONObject json, IOAcknowledge ack)
          On message.
 void onMessage(java.lang.String data, IOAcknowledge ack)
          On message.
 

Method Detail

onDisconnect

void onDisconnect()
On disconnect. Called when the socket disconnects and there are no further attempts to reconnect


onConnect

void onConnect()
On connect. Called when the socket becomes ready so it is now able to receive data


onMessage

void onMessage(java.lang.String data,
               IOAcknowledge ack)
On message. Called when the server sends String data.

Parameters:
data - the data.
ack - an IOAcknowledge instance, may be null if there's none

onMessage

void onMessage(org.json.JSONObject json,
               IOAcknowledge ack)
On message. Called when the server sends JSON data.

Parameters:
json - JSON object sent by server.
ack - an IOAcknowledge instance, may be null if there's none

on

void on(java.lang.String event,
        IOAcknowledge ack,
        java.lang.Object... args)
On [Event]. Called when server emits an event.

Parameters:
event - Name of the event
ack - an IOAcknowledge instance, may be null if there's none
args - Arguments of the event

onError

void onError(SocketIOException socketIOException)
On error. Called when socket is in an undefined state. No reconnect attempts will be made.

Parameters:
socketIOException - the last exception describing the error