com.pusher.client.connection
Interface Connection

All Known Subinterfaces:
InternalConnection
All Known Implementing Classes:
WebSocketConnection

public interface Connection

Represents a connection to Pusher.


Method Summary
 void bind(ConnectionState state, ConnectionEventListener eventListener)
          Bind to connection events.
 void connect()
          No need to call this via the API.
 String getSocketId()
          Gets a unique connection ID.
 ConnectionState getState()
          Gets the current connection state.
 boolean unbind(ConnectionState state, ConnectionEventListener eventListener)
          Unbind from connection state changes.
 

Method Detail

connect

void connect()
No need to call this via the API. Instead use com.pusher.client.Pusher.connect().


bind

void bind(ConnectionState state,
          ConnectionEventListener eventListener)
Bind to connection events.

Parameters:
state - The states to bind to.
eventListener - A listener to be called when the state changes.

unbind

boolean unbind(ConnectionState state,
               ConnectionEventListener eventListener)
Unbind from connection state changes.

Parameters:
state - The state to unbind from.
eventListener - The listener to be unbound.
Returns:
true if the unbind was successful, otherwise false.

getState

ConnectionState getState()
Gets the current connection state.

Returns:
The state.

getSocketId

String getSocketId()
Gets a unique connection ID.

Returns:
The id.


Copyright © 2013 Pusher. All Rights Reserved.