com.github.nkzawa.socketio.client
Class Manager

java.lang.Object
  extended by com.github.nkzawa.emitter.Emitter
      extended by com.github.nkzawa.socketio.client.Manager

public class Manager
extends com.github.nkzawa.emitter.Emitter

Manager class represents a connection to a given Socket.IO server.


Nested Class Summary
static interface Manager.OpenCallback
           
static class Manager.Options
           
 
Nested classes/interfaces inherited from class com.github.nkzawa.emitter.Emitter
com.github.nkzawa.emitter.Emitter.Listener
 
Field Summary
static String EVENT_CLOSE
          Called on a disconnection.
static String EVENT_CONNECT_ERROR
          Called on a connection error.
static String EVENT_CONNECT_TIMEOUT
          Called on a connection timeout.
static String EVENT_ERROR
           
static String EVENT_OPEN
          Called on a successful connection.
static String EVENT_PACKET
           
static String EVENT_RECONNECT
          Called on a successful reconnection.
static String EVENT_RECONNECT_ATTEMPT
           
static String EVENT_RECONNECT_ERROR
          Called on a reconnection attempt error.
static String EVENT_RECONNECT_FAILED
           
static String EVENT_RECONNECTING
           
static String EVENT_TRANSPORT
          Called when a new transport is created.
 
Constructor Summary
Manager()
           
Manager(Manager.Options opts)
           
Manager(URI uri)
           
Manager(URI uri, Manager.Options opts)
           
 
Method Summary
 Manager open()
           
 Manager open(Manager.OpenCallback fn)
          Connects the client.
 boolean reconnection()
           
 Manager reconnection(boolean v)
           
 int reconnectionAttempts()
           
 Manager reconnectionAttempts(int v)
           
 long reconnectionDelay()
           
 Manager reconnectionDelay(long v)
           
 long reconnectionDelayMax()
           
 Manager reconnectionDelayMax(long v)
           
 Socket socket(String nsp)
          Initializes Socket instances for each namespaces.
 long timeout()
           
 Manager timeout(long v)
           
 
Methods inherited from class com.github.nkzawa.emitter.Emitter
emit, hasListeners, listeners, off, off, off, on, once
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_OPEN

public static final String EVENT_OPEN
Called on a successful connection.

See Also:
Constant Field Values

EVENT_CLOSE

public static final String EVENT_CLOSE
Called on a disconnection.

See Also:
Constant Field Values

EVENT_PACKET

public static final String EVENT_PACKET
See Also:
Constant Field Values

EVENT_ERROR

public static final String EVENT_ERROR
See Also:
Constant Field Values

EVENT_CONNECT_ERROR

public static final String EVENT_CONNECT_ERROR
Called on a connection error.

See Also:
Constant Field Values

EVENT_CONNECT_TIMEOUT

public static final String EVENT_CONNECT_TIMEOUT
Called on a connection timeout.

See Also:
Constant Field Values

EVENT_RECONNECT

public static final String EVENT_RECONNECT
Called on a successful reconnection.

See Also:
Constant Field Values

EVENT_RECONNECT_ERROR

public static final String EVENT_RECONNECT_ERROR
Called on a reconnection attempt error.

See Also:
Constant Field Values

EVENT_RECONNECT_FAILED

public static final String EVENT_RECONNECT_FAILED
See Also:
Constant Field Values

EVENT_RECONNECT_ATTEMPT

public static final String EVENT_RECONNECT_ATTEMPT
See Also:
Constant Field Values

EVENT_RECONNECTING

public static final String EVENT_RECONNECTING
See Also:
Constant Field Values

EVENT_TRANSPORT

public static final String EVENT_TRANSPORT
Called when a new transport is created. (experimental)

See Also:
Constant Field Values
Constructor Detail

Manager

public Manager()

Manager

public Manager(URI uri)

Manager

public Manager(Manager.Options opts)

Manager

public Manager(URI uri,
               Manager.Options opts)
Method Detail

reconnection

public boolean reconnection()

reconnection

public Manager reconnection(boolean v)

reconnectionAttempts

public int reconnectionAttempts()

reconnectionAttempts

public Manager reconnectionAttempts(int v)

reconnectionDelay

public long reconnectionDelay()

reconnectionDelay

public Manager reconnectionDelay(long v)

reconnectionDelayMax

public long reconnectionDelayMax()

reconnectionDelayMax

public Manager reconnectionDelayMax(long v)

timeout

public long timeout()

timeout

public Manager timeout(long v)

open

public Manager open()

open

public Manager open(Manager.OpenCallback fn)
Connects the client.

Parameters:
fn - callback.
Returns:
a reference to this object.

socket

public Socket socket(String nsp)
Initializes Socket instances for each namespaces.

Parameters:
nsp - namespace.
Returns:
a socket instance for the namespace.


Copyright © 2014. All rights reserved.