Package com.pusher.client.connection
Interface Connection
-
public interface Connection
Represents a connection to Pusher.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbind(ConnectionState state, ConnectionEventListener eventListener)Bind to connection events.voidconnect()No need to call this via the API.java.lang.StringgetSocketId()Gets a unique connection ID.ConnectionStategetState()Gets the current connection state.booleanunbind(ConnectionState state, ConnectionEventListener eventListener)Unbind from connection state changes.
-
-
-
Method Detail
-
connect
void connect()
No need to call this via the API. Instead usePusher.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:
trueif the unbind was successful, otherwisefalse.
-
getState
ConnectionState getState()
Gets the current connection state.- Returns:
- The state.
-
getSocketId
java.lang.String getSocketId()
Gets a unique connection ID.- Returns:
- The id.
-
-