public final class ReconnectingWebSocket
extends java.lang.Object
implements okhttp3.ws.WebSocketListener
Modifier and Type | Class and Description |
---|---|
static interface |
ReconnectingWebSocket.ConnectionCallback |
static interface |
ReconnectingWebSocket.MessageCallback |
Constructor and Description |
---|
ReconnectingWebSocket(java.lang.String url,
ReconnectingWebSocket.MessageCallback messageCallback,
ReconnectingWebSocket.ConnectionCallback connectionCallback) |
Modifier and Type | Method and Description |
---|---|
void |
closeQuietly() |
void |
connect() |
void |
onClose(int code,
java.lang.String reason) |
void |
onFailure(java.io.IOException e,
okhttp3.Response response) |
void |
onMessage(okhttp3.ResponseBody message) |
void |
onOpen(okhttp3.ws.WebSocket webSocket,
okhttp3.Response response) |
void |
onPong(okio.Buffer payload) |
void |
sendMessage(okhttp3.RequestBody message) |
public ReconnectingWebSocket(java.lang.String url, ReconnectingWebSocket.MessageCallback messageCallback, ReconnectingWebSocket.ConnectionCallback connectionCallback)
public void connect()
public void closeQuietly()
public void onOpen(okhttp3.ws.WebSocket webSocket, okhttp3.Response response)
onOpen
in interface okhttp3.ws.WebSocketListener
public void onFailure(java.io.IOException e, okhttp3.Response response)
onFailure
in interface okhttp3.ws.WebSocketListener
public void onMessage(okhttp3.ResponseBody message)
onMessage
in interface okhttp3.ws.WebSocketListener
public void onPong(okio.Buffer payload)
onPong
in interface okhttp3.ws.WebSocketListener
public void onClose(int code, java.lang.String reason)
onClose
in interface okhttp3.ws.WebSocketListener
public void sendMessage(okhttp3.RequestBody message) throws java.io.IOException
java.io.IOException