Class AcknowledgeExample

java.lang.Object
  extended by AcknowledgeExample
All Implemented Interfaces:
IOCallback

public class AcknowledgeExample
extends java.lang.Object
implements IOCallback


Constructor Summary
AcknowledgeExample()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcknowledgeExample

public AcknowledgeExample()
                   throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args -

onMessage

public void onMessage(org.json.JSONObject json,
                      IOAcknowledge ack)
Description copied from interface: IOCallback
On message. Called when the server sends JSON data.

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

onMessage

public void onMessage(java.lang.String data,
                      IOAcknowledge ack)
Description copied from interface: IOCallback
On message. Called when the server sends String data.

Specified by:
onMessage in interface IOCallback
Parameters:
data - the data.
ack - an IOAcknowledge instance, may be null if there's none

onError

public void onError(SocketIOException socketIOException)
Description copied from interface: IOCallback
On error. Called when socket is in an undefined state. No reconnect attempts will be made.

Specified by:
onError in interface IOCallback
Parameters:
socketIOException - the last exception describing the error

onDisconnect

public void onDisconnect()
Description copied from interface: IOCallback
On disconnect. Called when the socket disconnects and there are no further attempts to reconnect

Specified by:
onDisconnect in interface IOCallback

onConnect

public void onConnect()
Description copied from interface: IOCallback
On connect. Called when the socket becomes ready so it is now able to receive data

Specified by:
onConnect in interface IOCallback

on

public void on(java.lang.String event,
               IOAcknowledge ack,
               java.lang.Object... args)
Description copied from interface: IOCallback
On [Event]. Called when server emits an event.

Specified by:
on in interface IOCallback
Parameters:
event - Name of the event
ack - an IOAcknowledge instance, may be null if there's none
args - Arguments of the event