| Modifier and Type | Method and Description |
|---|---|
WebSocket |
WebSocket.addExtension(String extension)
Add a value for
Sec-WebSocket-Extension. |
WebSocket |
WebSocket.addExtension(WebSocketExtension extension)
Add a value for
Sec-WebSocket-Extension. |
WebSocket |
WebSocket.addHeader(String name,
String value)
Add a pair of extra HTTP header.
|
WebSocket |
WebSocket.addListener(WebSocketListener listener)
Add a listener to receive events on this web socket.
|
WebSocket |
WebSocket.addListeners(List<WebSocketListener> listeners)
Add listeners.
|
WebSocket |
WebSocket.addProtocol(String protocol)
Add a value for
Sec-WebSocket-Protocol. |
WebSocket |
WebSocket.clearExtensions()
Remove all extensions from
Sec-WebSocket-Extension. |
WebSocket |
WebSocket.clearHeaders()
Clear all extra HTTP headers.
|
WebSocket |
WebSocket.clearListeners()
Remove all the listeners from this web socket.
|
WebSocket |
WebSocket.clearProtocols()
Remove all protocols from
Sec-WebSocket-Protocol. |
WebSocket |
WebSocket.clearUserInfo()
Clear the credentials to connect to the web socket endpoint.
|
WebSocket |
WebSocket.connect()
Send an opening handshake to the server, receive the response and then
start threads to communicate with the server.
|
WebSocket |
WebSocket.connectAsynchronously()
Execute
connect() asynchronously by creating a new thread and
calling connect() in the thread. |
WebSocket |
WebSocketFactory.createSocket(String uri)
Create a web socket.
|
WebSocket |
WebSocketFactory.createSocket(String uri,
int timeout)
Create a web socket.
|
WebSocket |
WebSocketFactory.createSocket(URI uri)
Create a web socket.
|
WebSocket |
WebSocketFactory.createSocket(URI uri,
int timeout)
Create a web socket.
|
WebSocket |
WebSocketFactory.createSocket(URL url)
Create a web socket.
|
WebSocket |
WebSocketFactory.createSocket(URL url,
int timeout)
Create a web socket.
|
WebSocket |
WebSocket.disconnect()
Disconnect the web socket.
|
WebSocket |
WebSocket.disconnect(int closeCode)
Disconnect the web socket.
|
WebSocket |
WebSocket.disconnect(int closeCode,
String reason)
Disconnect the web socket.
|
WebSocket |
WebSocket.disconnect(String reason)
Disconnect the web socket.
|
WebSocket |
WebSocket.flush()
Flush frames to the server.
|
WebSocket |
WebSocket.recreate()
Create a new
WebSocket instance that has the same settings
as this instance. |
WebSocket |
WebSocket.recreate(int timeout)
Create a new
WebSocket instance that has the same settings
as this instance. |
WebSocket |
WebSocket.removeExtension(WebSocketExtension extension)
Remove an extension from
Sec-WebSocket-Extension. |
WebSocket |
WebSocket.removeExtensions(String name)
Remove extensions from
Sec-WebSocket-Extension by
an extension name. |
WebSocket |
WebSocket.removeHeaders(String name)
Remove pairs of extra HTTP headers.
|
WebSocket |
WebSocket.removeListener(WebSocketListener listener)
Remove a listener from this web socket.
|
WebSocket |
WebSocket.removeListeners(List<WebSocketListener> listeners)
Remove listeners.
|
WebSocket |
WebSocket.removeProtocol(String protocol)
Remove a protocol from
Sec-WebSocket-Protocol. |
WebSocket |
WebSocket.sendBinary(byte[] message)
Send a binary message to the server.
|
WebSocket |
WebSocket.sendBinary(byte[] payload,
boolean fin)
Send a binary frame to the server.
|
WebSocket |
WebSocket.sendClose()
Send a close frame to the server.
|
WebSocket |
WebSocket.sendClose(int closeCode)
Send a close frame to the server.
|
WebSocket |
WebSocket.sendClose(int closeCode,
String reason)
Send a close frame to the server.
|
WebSocket |
WebSocket.sendContinuation()
Send a continuation frame to the server.
|
WebSocket |
WebSocket.sendContinuation(boolean fin)
Send a continuation frame to the server.
|
WebSocket |
WebSocket.sendContinuation(byte[] payload)
Send a continuation frame to the server.
|
WebSocket |
WebSocket.sendContinuation(byte[] payload,
boolean fin)
Send a continuation frame to the server.
|
WebSocket |
WebSocket.sendContinuation(String payload)
Send a continuation frame to the server.
|
WebSocket |
WebSocket.sendContinuation(String payload,
boolean fin)
Send a continuation frame to the server.
|
WebSocket |
WebSocket.sendFrame(WebSocketFrame frame)
Send a web socket frame to the server.
|
WebSocket |
WebSocket.sendPing()
Send a ping frame to the server.
|
WebSocket |
WebSocket.sendPing(byte[] payload)
Send a ping frame to the server.
|
WebSocket |
WebSocket.sendPing(String payload)
Send a ping frame to the server.
|
WebSocket |
WebSocket.sendPong()
Send a pong frame to the server.
|
WebSocket |
WebSocket.sendPong(byte[] payload)
Send a pong frame to the server.
|
WebSocket |
WebSocket.sendPong(String payload)
Send a pong frame to the server.
|
WebSocket |
WebSocket.sendText(String message)
Send a text message to the server.
|
WebSocket |
WebSocket.sendText(String payload,
boolean fin)
Send a text frame to the server.
|
WebSocket |
WebSocket.setAutoFlush(boolean auto)
Enable or disable auto-flush of sent frames.
|
WebSocket |
WebSocket.setExtended(boolean extended)
Allow or disallow extended use of web socket frames.
|
WebSocket |
WebSocket.setFrameQueueSize(int size)
Set the size of the frame queue.
|
WebSocket |
WebSocket.setPingInterval(long interval)
Set the interval of periodical
ping
frames.
|
WebSocket |
WebSocket.setPongInterval(long interval)
Set the interval of periodical
pong
frames.
|
WebSocket |
WebSocket.setUserInfo(String userInfo)
Set the credentials to connect to the web socket endpoint.
|
WebSocket |
WebSocket.setUserInfo(String id,
String password)
Set the credentials to connect to the web socket endpoint.
|
| Modifier and Type | Method and Description |
|---|---|
Future<WebSocket> |
WebSocket.connect(ExecutorService executorService)
Execute
connect() asynchronously using the given ExecutorService. |
Callable<WebSocket> |
WebSocket.connectable()
|
| Modifier and Type | Method and Description |
|---|---|
void |
WebSocketListener.handleCallbackError(WebSocket websocket,
Throwable cause)
Called when an
onXxx() method threw a Throwable. |
void |
WebSocketAdapter.handleCallbackError(WebSocket websocket,
Throwable cause) |
void |
WebSocketListener.onBinaryFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a binary frame (opcode = 0x2) was received.
|
void |
WebSocketAdapter.onBinaryFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onBinaryMessage(WebSocket websocket,
byte[] binary)
Called when a binary message was received.
|
void |
WebSocketAdapter.onBinaryMessage(WebSocket websocket,
byte[] binary) |
void |
WebSocketListener.onCloseFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a close frame (opcode = 0x8) was received.
|
void |
WebSocketAdapter.onCloseFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onConnected(WebSocket websocket,
Map<String,List<String>> headers)
Called after the opening handshake of the web socket connection succeeded.
|
void |
WebSocketAdapter.onConnected(WebSocket websocket,
Map<String,List<String>> headers) |
void |
WebSocketListener.onConnectError(WebSocket websocket,
WebSocketException cause)
Called when
connectAsynchronously() failed. |
void |
WebSocketAdapter.onConnectError(WebSocket websocket,
WebSocketException exception) |
void |
WebSocketListener.onContinuationFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a continuation frame (opcode = 0x0) was received.
|
void |
WebSocketAdapter.onContinuationFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onDisconnected(WebSocket websocket,
WebSocketFrame serverCloseFrame,
WebSocketFrame clientCloseFrame,
boolean closedByServer)
Called after the web socket connection was closed.
|
void |
WebSocketAdapter.onDisconnected(WebSocket websocket,
WebSocketFrame serverCloseFrame,
WebSocketFrame clientCloseFrame,
boolean closedByServer) |
void |
WebSocketListener.onError(WebSocket websocket,
WebSocketException cause)
Call when an error occurred.
|
void |
WebSocketAdapter.onError(WebSocket websocket,
WebSocketException cause) |
void |
WebSocketListener.onFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a frame was received.
|
void |
WebSocketAdapter.onFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onFrameError(WebSocket websocket,
WebSocketException cause,
WebSocketFrame frame)
Called when a frame failed to be read from the web socket.
|
void |
WebSocketAdapter.onFrameError(WebSocket websocket,
WebSocketException cause,
WebSocketFrame frame) |
void |
WebSocketListener.onFrameSent(WebSocket websocket,
WebSocketFrame frame)
Called when a web socket frame was sent to the server
(but not flushed yet).
|
void |
WebSocketAdapter.onFrameSent(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onFrameUnsent(WebSocket websocket,
WebSocketFrame frame)
Called when a web socket frame was not sent to the server
because a close frame has already been sent.
|
void |
WebSocketAdapter.onFrameUnsent(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onMessageDecompressionError(WebSocket websocket,
WebSocketException cause,
byte[] compressed)
Called when it failed to decompress a message.
|
void |
WebSocketAdapter.onMessageDecompressionError(WebSocket websocket,
WebSocketException cause,
byte[] compressed) |
void |
WebSocketListener.onMessageError(WebSocket websocket,
WebSocketException cause,
List<WebSocketFrame> frames)
Called when it failed to concatenate payloads of multiple frames
to construct a message.
|
void |
WebSocketAdapter.onMessageError(WebSocket websocket,
WebSocketException cause,
List<WebSocketFrame> frames) |
void |
WebSocketListener.onPingFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a ping frame (opcode = 0x9) was received.
|
void |
WebSocketAdapter.onPingFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onPongFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a pong frame (opcode = 0xA) was received.
|
void |
WebSocketAdapter.onPongFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onSendError(WebSocket websocket,
WebSocketException cause,
WebSocketFrame frame)
Called when an error occurred when a frame was tried to be sent
to the server.
|
void |
WebSocketAdapter.onSendError(WebSocket websocket,
WebSocketException cause,
WebSocketFrame frame) |
void |
WebSocketListener.onSendingFrame(WebSocket websocket,
WebSocketFrame frame)
Called before a web socket frame is sent.
|
void |
WebSocketAdapter.onSendingFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onStateChanged(WebSocket websocket,
WebSocketState newState)
Called after the state of the web socket changed.
|
void |
WebSocketAdapter.onStateChanged(WebSocket websocket,
WebSocketState newState) |
void |
WebSocketListener.onTextFrame(WebSocket websocket,
WebSocketFrame frame)
Called when a text frame (opcode = 0x1) was received.
|
void |
WebSocketAdapter.onTextFrame(WebSocket websocket,
WebSocketFrame frame) |
void |
WebSocketListener.onTextMessage(WebSocket websocket,
String text)
Called when a text message was received.
|
void |
WebSocketAdapter.onTextMessage(WebSocket websocket,
String text) |
void |
WebSocketListener.onTextMessageError(WebSocket websocket,
WebSocketException cause,
byte[] data)
Called when it failed to convert payload data into a string.
|
void |
WebSocketAdapter.onTextMessageError(WebSocket websocket,
WebSocketException cause,
byte[] data) |
void |
WebSocketListener.onUnexpectedError(WebSocket websocket,
WebSocketException cause)
Called when an uncaught throwable was detected in either the
reading thread (which reads frames from the server) or the
writing thread (which sends frames to the server).
|
void |
WebSocketAdapter.onUnexpectedError(WebSocket websocket,
WebSocketException cause) |
Copyright © 2015. All rights reserved.