public final class RealWebSocket extends Object implements WebSocket, WebSocketReader.FrameCallback
| Modifier and Type | Class and Description |
|---|---|
static class |
RealWebSocket.Streams |
WebSocket.Factory| Constructor and Description |
|---|
RealWebSocket(Request request,
WebSocketListener listener,
Random random,
long pingIntervalMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
boolean |
close(int code,
String reason) |
void |
connect(HttpClient client) |
void |
failWebSocket(Exception e,
Response response) |
void |
initReaderAndWriter(String name,
RealWebSocket.Streams streams) |
void |
loopReader() |
void |
onReadClose(int code,
String reason) |
void |
onReadMessage(ByteString bytes) |
void |
onReadMessage(String text) |
void |
onReadPing(ByteString payload) |
void |
onReadPong(ByteString buffer) |
long |
queueSize() |
Request |
request() |
boolean |
send(ByteString bytes) |
boolean |
send(String text) |
public RealWebSocket(Request request, WebSocketListener listener, Random random, long pingIntervalMillis)
public void connect(HttpClient client)
public void initReaderAndWriter(String name, RealWebSocket.Streams streams) throws IOException
IOExceptionpublic void loopReader()
throws IOException
IOExceptionpublic void onReadMessage(String text) throws IOException
onReadMessage in interface WebSocketReader.FrameCallbackIOExceptionpublic void onReadMessage(ByteString bytes) throws IOException
onReadMessage in interface WebSocketReader.FrameCallbackIOExceptionpublic void onReadPing(ByteString payload)
onReadPing in interface WebSocketReader.FrameCallbackpublic void onReadPong(ByteString buffer)
onReadPong in interface WebSocketReader.FrameCallbackpublic void onReadClose(int code,
String reason)
onReadClose in interface WebSocketReader.FrameCallbackpublic boolean send(ByteString bytes)
Copyright © 2019. All rights reserved.