| Constructor and Description |
|---|
EndpointAdapter() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
onBinaryMessage(WebSocket ws,
byte[] message)
A binary message has been received.
|
void |
onClose(WebSocket ws,
ReasonForClosure closeReason)
The associated
WebSocket is about to close. |
void |
onError(WebSocket ws,
Throwable thr)
An error occurred on the
WebSocket. |
void |
onOpen(WebSocket ws)
The connection has been established.
|
void |
onPing(byte[] data)
A ping frame has been received.
|
void |
onPong(byte[] data)
A pong frame has been received.
|
String |
onTextMessage(WebSocket ws,
String message)
A text message has been received.
|
public byte[] onBinaryMessage(WebSocket ws, byte[] message)
EndpointIf the return value is not null, then it is sent to the remote endpoint.
onBinaryMessage in interface Endpointws - the WebSocket on which the event occurredmessage - the received messagepublic void onClose(WebSocket ws, ReasonForClosure closeReason)
EndpointWebSocket is about to close. This method is called if the remote endpoint started a closing handshake (that is, a
close control frame has been received and connection state was OPEN), or if the local application request to close the connection.
The underlying socket connection may already be closed to you should not try to send any further message in this callback.
public void onError(WebSocket ws, Throwable thr)
EndpointWebSocket.public void onOpen(WebSocket ws)
Endpointpublic void onPing(byte[] data)
Endpointpublic void onPong(byte[] data)
Endpointpublic String onTextMessage(WebSocket ws, String message)
EndpointIf the return value is not null, then it is sent to the remote endpoint.
onTextMessage in interface Endpointws - the WebSocket on which the event occurredmessage - the received message