|
||||||||||
| 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()
Connectioncom.pusher.client.Pusher.connect().
connect in interface Connectionpublic void disconnect()
disconnect in interface InternalConnection
public void bind(ConnectionState state,
ConnectionEventListener eventListener)
Connection
bind in interface Connectionstate - 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 Connectionstate - 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 Connectionpublic void sendMessage(String message)
sendMessage in interface InternalConnectionpublic String getSocketId()
Connection
getSocketId in interface Connectionpublic void onOpen(ServerHandshake handshakedata)
onOpen in interface WebSocketListenerpublic void onMessage(String message)
onMessage in interface WebSocketListener
public void onClose(int code,
String reason,
boolean remote)
onClose in interface WebSocketListenerpublic void onError(Exception ex)
onError in interface WebSocketListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||