|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.pusher.client.connection.websocket.WebSocketConnection
public class WebSocketConnection
Constructor Summary | |
---|---|
WebSocketConnection(String apiKey,
boolean encrypted)
|
Method Summary | |
---|---|
void |
bind(ConnectionState state,
ConnectionEventListener eventListener)
Bind to connection events. |
void |
connect()
No need to call this via the API. |
void |
disconnect()
|
String |
getSocketId()
Gets a unique connection ID. |
ConnectionState |
getState()
Gets the current connection state. |
void |
onClose(int code,
String reason,
boolean remote)
|
void |
onError(Exception ex)
|
void |
onMessage(String message)
|
void |
onOpen(ServerHandshake handshakedata)
|
void |
sendMessage(String message)
InternalConnection implementation detail |
boolean |
unbind(ConnectionState state,
ConnectionEventListener eventListener)
Unbind from connection state changes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebSocketConnection(String apiKey, boolean encrypted) throws URISyntaxException
URISyntaxException
Method Detail |
---|
public void connect()
Connection
com.pusher.client.Pusher.connect()
.
connect
in interface Connection
public void disconnect()
disconnect
in interface InternalConnection
public void bind(ConnectionState state, ConnectionEventListener eventListener)
Connection
bind
in interface Connection
state
- The states to bind to.eventListener
- A listener to be called when the state changes.public boolean unbind(ConnectionState state, ConnectionEventListener eventListener)
Connection
unbind
in interface Connection
state
- The state to unbind from.eventListener
- The listener to be unbound.
true
if the unbind was successful, otherwise false
.public ConnectionState getState()
Connection
getState
in interface Connection
public void sendMessage(String message)
sendMessage
in interface InternalConnection
public String getSocketId()
Connection
getSocketId
in interface Connection
public void onOpen(ServerHandshake handshakedata)
onOpen
in interface WebSocketListener
public void onMessage(String message)
onMessage
in interface WebSocketListener
public void onClose(int code, String reason, boolean remote)
onClose
in interface WebSocketListener
public void onError(Exception ex)
onError
in interface WebSocketListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |