public static WebSocket.Listener
A listener of events on a class WebSocket
.
class WebSocket
Modifier and Type | Method and Description |
---|---|
void |
onConnected(WebSocket webSocket)
Tells the listener that the socket is connected to the device.
|
void |
onDataReceived(WebSocket webSocket,
java.lang.String data)
Tells the listener that the socket has received a message.
|
void |
onDisconnected(WebSocket webSocket,
java.lang.Throwable error)
Tells the listener that the socket has been disconnected from the device.
|
void onDataReceived(@NotNull WebSocket webSocket, @NotNull java.lang.String data)
Tells the listener that the socket has received a message.
webSocket
- The web socket which informs the listener.data
- : The message received.void onDisconnected(@NotNull WebSocket webSocket, @Nullable java.lang.Throwable error)
Tells the listener that the socket has been disconnected from the device.
webSocket
- The web socket which informs the listener.error
- The disconnection error, or null
if the disconnection was initiated by the user.void onConnected(@NotNull WebSocket webSocket)
Tells the listener that the socket is connected to the device.
webSocket
- The web socket which informs the listener.