public abstract class WebSocketListener extends Object
| Constructor and Description |
|---|
WebSocketListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onClosed(WebSocket webSocket,
int code,
String reason)
Invoked when both peers have indicated that no more messages will be transmitted and the
connection has been successfully released.
|
void |
onClosing(WebSocket webSocket,
int code,
String reason)
Invoked when the peer has indicated that no more incoming messages will be transmitted.
|
void |
onFailure(WebSocket webSocket,
Throwable t,
Response response)
Invoked when a web socket has been closed due to an error reading from or writing to the
network.
|
void |
onMessage(WebSocket webSocket,
okio.ByteString bytes)
Invoked when a binary (type
0x2) message has been received. |
void |
onMessage(WebSocket webSocket,
String text)
Invoked when a text (type
0x1) message has been received. |
void |
onOpen(WebSocket webSocket,
Response response)
Invoked when a web socket has been accepted by the remote peer and may begin transmitting
messages.
|
public void onOpen(WebSocket webSocket, Response response)
public void onMessage(WebSocket webSocket, String text)
0x1) message has been received.public void onMessage(WebSocket webSocket, okio.ByteString bytes)
0x2) message has been received.public void onClosing(WebSocket webSocket, int code, String reason)
public void onClosed(WebSocket webSocket, int code, String reason)
Copyright © 2017. All Rights Reserved.