public class WebSocketProxy extends Object implements com.squareup.okhttp.ws.WebSocketListener
| Modifier and Type | Field and Description |
|---|---|
protected ArtikCloudWebSocketCallback |
callback |
protected com.squareup.okhttp.OkHttpClient |
client |
protected CountDownLatch |
closeSignal |
protected static String |
host |
protected JSON |
json |
protected CountDownLatch |
openSignal |
protected com.squareup.okhttp.Request |
request |
protected ScheduledExecutorService |
scheduler |
protected ConnectionStatus |
status |
protected com.squareup.okhttp.ws.WebSocket |
webSocket |
| Constructor and Description |
|---|
WebSocketProxy(String url,
com.squareup.okhttp.OkHttpClient client,
ArtikCloudWebSocketCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeBlocking() |
void |
connect() |
void |
connectBlocking() |
ConnectionStatus |
getConnectionStatus() |
void |
onClose(int code,
String reason) |
void |
onFailure(IOException exc,
com.squareup.okhttp.Response response) |
void |
onMessage(com.squareup.okhttp.ResponseBody response) |
void |
onOpen(com.squareup.okhttp.ws.WebSocket webSocket,
com.squareup.okhttp.Response response) |
void |
onPong(okio.Buffer arg0) |
protected void |
sendObject(Object object) |
static void |
setHost(String host) |
protected com.squareup.okhttp.Request request
protected com.squareup.okhttp.ws.WebSocket webSocket
protected ArtikCloudWebSocketCallback callback
protected com.squareup.okhttp.OkHttpClient client
protected final JSON json
protected final ScheduledExecutorService scheduler
protected ConnectionStatus status
protected CountDownLatch openSignal
protected CountDownLatch closeSignal
protected static String host
public WebSocketProxy(String url, com.squareup.okhttp.OkHttpClient client, ArtikCloudWebSocketCallback callback)
public static void setHost(String host)
public ConnectionStatus getConnectionStatus()
public final void onOpen(com.squareup.okhttp.ws.WebSocket webSocket,
com.squareup.okhttp.Response response)
public final void onClose(int code,
String reason)
public final void onFailure(IOException exc, com.squareup.okhttp.Response response)
public final void onMessage(com.squareup.okhttp.ResponseBody response)
throws IOException
public final void onPong(okio.Buffer arg0)
public final void connect()
throws IOException
public final void connectBlocking()
throws IOException,
InterruptedException
public final void close()
throws IOException
public final void closeBlocking()
throws IOException,
InterruptedException
protected void sendObject(Object object) throws IOException
Copyright © 2016. All rights reserved.