public final class WebSocketEcho extends Object implements WebSocketListener
| Constructor and Description |
|---|
WebSocketEcho() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String... args) |
void |
onClose(int code,
String reason)
Called when the server sends a close message.
|
void |
onFailure(IOException e)
Called when the transport-layer of this web socket errors during
communication.
|
void |
onMessage(okio.BufferedSource payload,
WebSocket.PayloadType type)
Called when a server message is received.
|
public void onMessage(okio.BufferedSource payload,
WebSocket.PayloadType type)
throws IOException
WebSocketListenertype indicates whether the
payload should be interpreted as UTF-8 text or binary data.onMessage in interface WebSocketListenerIOExceptionpublic void onClose(int code,
String reason)
WebSocketListenerclose() or as an unprompted
message from the server.onClose in interface WebSocketListenercode - The
public void onFailure(IOException e)
WebSocketListeneronFailure in interface WebSocketListenerpublic static void main(String... args) throws IOException
IOExceptionCopyright © 2015. All rights reserved.