Uses of Class
com.neovisionaries.ws.client.WebSocket
-
Uses of WebSocket in com.neovisionaries.ws.client
Fields in com.neovisionaries.ws.client declared as WebSocketModifier and TypeFieldDescriptionprivate final WebSocket
Connectable.mWebSocket
private final WebSocket
HandshakeReader.mWebSocket
private final WebSocket
ListenerManager.mWebSocket
private final WebSocket
PeriodicalFrameSender.mWebSocket
protected final WebSocket
WebSocketThread.mWebSocket
Methods in com.neovisionaries.ws.client that return WebSocketModifier and TypeMethodDescriptionWebSocket.addExtension
(WebSocketExtension extension) Add a value forSec-WebSocket-Extension
.WebSocket.addExtension
(String extension) Add a value forSec-WebSocket-Extension
.Add a pair of extra HTTP header.WebSocket.addListener
(WebSocketListener listener) Add a listener to receive events on this WebSocket.WebSocket.addListeners
(List<WebSocketListener> listeners) Add listeners.WebSocket.addProtocol
(String protocol) Add a value forSec-WebSocket-Protocol
.Connectable.call()
WebSocket.clearExtensions()
Remove all extensions fromSec-WebSocket-Extension
.WebSocket.clearHeaders()
Clear all extra HTTP headers.WebSocket.clearListeners()
Remove all the listeners from this WebSocket.WebSocket.clearProtocols()
Remove all protocols fromSec-WebSocket-Protocol
.WebSocket.clearUserInfo()
Clear the credentials to connect to the WebSocket endpoint.WebSocket.connect()
Connect to the server, send an opening handshake to the server, receive the response and then start threads to communicate with the server.WebSocket.connectAsynchronously()
Executeconnect()
asynchronously by creating a new thread and callingconnect()
in the thread.WebSocketFactory.createSocket
(String uri) Create a WebSocket.WebSocketFactory.createSocket
(String uri, int timeout) Create a WebSocket.private WebSocket
WebSocketFactory.createSocket
(String scheme, String userInfo, String host, int port, String path, String query, int timeout) WebSocketFactory.createSocket
(URI uri) Create a WebSocket.WebSocketFactory.createSocket
(URI uri, int timeout) Create a WebSocket.WebSocketFactory.createSocket
(URL url) Create a WebSocket.WebSocketFactory.createSocket
(URL url, int timeout) Create a WebSocket.private WebSocket
WebSocketFactory.createWebSocket
(boolean secure, String userInfo, String host, int port, String path, String query, SocketConnector connector) WebSocket.disconnect()
Disconnect the WebSocket.WebSocket.disconnect
(int closeCode) Disconnect the WebSocket.WebSocket.disconnect
(int closeCode, String reason) Disconnect the WebSocket.WebSocket.disconnect
(int closeCode, String reason, long closeDelay) Disconnect the WebSocket.WebSocket.disconnect
(String reason) Disconnect the WebSocket.WebSocket.flush()
Flush frames to the server.WebSocket.recreate()
Create a newWebSocket
instance that has the same settings as this instance.WebSocket.recreate
(int timeout) Create a newWebSocket
instance that has the same settings as this instance.WebSocket.removeExtension
(WebSocketExtension extension) Remove an extension fromSec-WebSocket-Extension
.WebSocket.removeExtensions
(String name) Remove extensions fromSec-WebSocket-Extension
by an extension name.WebSocket.removeHeaders
(String name) Remove pairs of extra HTTP headers.WebSocket.removeListener
(WebSocketListener listener) Remove a listener from this WebSocket.WebSocket.removeListeners
(List<WebSocketListener> listeners) Remove listeners.WebSocket.removeProtocol
(String protocol) Remove a protocol fromSec-WebSocket-Protocol
.WebSocket.sendBinary
(byte[] message) Send a binary message to the server.WebSocket.sendBinary
(byte[] payload, boolean fin) Send a binary frame to the server.WebSocket.sendClose()
Send a close frame to the server.WebSocket.sendClose
(int closeCode) Send a close frame to the server.Send a close frame to the server.WebSocket.sendContinuation()
Send a continuation frame to the server.WebSocket.sendContinuation
(boolean fin) Send a continuation frame to the server.WebSocket.sendContinuation
(byte[] payload) Send a continuation frame to the server.WebSocket.sendContinuation
(byte[] payload, boolean fin) Send a continuation frame to the server.WebSocket.sendContinuation
(String payload) Send a continuation frame to the server.WebSocket.sendContinuation
(String payload, boolean fin) Send a continuation frame to the server.WebSocket.sendFrame
(WebSocketFrame frame) Send a WebSocket frame to the server.WebSocket.sendPing()
Send a ping frame to the server.WebSocket.sendPing
(byte[] payload) Send a ping frame to the server.Send a ping frame to the server.WebSocket.sendPong()
Send a pong frame to the server.WebSocket.sendPong
(byte[] payload) Send a pong frame to the server.Send a pong frame to the server.Send a text message to the server.Send a text frame to the server.WebSocket.setAutoFlush
(boolean auto) Enable or disable auto-flush of sent frames.WebSocket.setDirectTextMessage
(boolean direct) Set whether to receive text messages directly as byte arrays without string conversion.WebSocket.setExtended
(boolean extended) Allow or disallow extended use of WebSocket frames.WebSocket.setFrameQueueSize
(int size) Set the size of the frame queue.WebSocket.setMaxPayloadSize
(int size) Set the maximum payload size.WebSocket.setMissingCloseFrameAllowed
(boolean allowed) Set whether to allow the server to close the WebSocket connection without sending a close frame to this client.WebSocket.setPingInterval
(long interval) Set the interval of periodical ping frames.WebSocket.setPingPayloadGenerator
(PayloadGenerator generator) Set the generator of payload of ping frames that are sent automatically.WebSocket.setPingSenderName
(String name) Set the name of theTimer
that sends ping frames periodically.WebSocket.setPongInterval
(long interval) Set the interval of periodical pong frames.WebSocket.setPongPayloadGenerator
(PayloadGenerator generator) Set the generator of payload of pong frames that are sent automatically.WebSocket.setPongSenderName
(String name) Set the name of theTimer
that sends pong frames periodically.WebSocket.setUserInfo
(String userInfo) Set the credentials to connect to the WebSocket endpoint.WebSocket.setUserInfo
(String id, String password) Set the credentials to connect to the WebSocket endpoint.Methods in com.neovisionaries.ws.client that return types with arguments of type WebSocketModifier and TypeMethodDescriptionWebSocket.connect
(ExecutorService executorService) Executeconnect()
asynchronously using the givenExecutorService
.WebSocket.connectable()
Methods in com.neovisionaries.ws.client with parameters of type WebSocketModifier and TypeMethodDescriptionvoid
WebSocketAdapter.handleCallbackError
(WebSocket websocket, Throwable cause) void
WebSocketListener.handleCallbackError
(WebSocket websocket, Throwable cause) Called when anonXxx()
method threw aThrowable
.void
WebSocketAdapter.onBinaryFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onBinaryFrame
(WebSocket websocket, WebSocketFrame frame) Called when a binary frame (opcode = 0x2) was received.void
WebSocketAdapter.onBinaryMessage
(WebSocket websocket, byte[] binary) void
WebSocketListener.onBinaryMessage
(WebSocket websocket, byte[] binary) Called when a binary message was received.void
WebSocketAdapter.onCloseFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onCloseFrame
(WebSocket websocket, WebSocketFrame frame) Called when a close frame (opcode = 0x8) was received.void
void
Called after the opening handshake of the WebSocket connection succeeded.void
WebSocketAdapter.onConnectError
(WebSocket websocket, WebSocketException exception) void
WebSocketListener.onConnectError
(WebSocket websocket, WebSocketException cause) Called whenconnectAsynchronously()
failed.void
WebSocketAdapter.onContinuationFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onContinuationFrame
(WebSocket websocket, WebSocketFrame frame) Called when a continuation frame (opcode = 0x0) was received.void
WebSocketAdapter.onDisconnected
(WebSocket websocket, WebSocketFrame serverCloseFrame, WebSocketFrame clientCloseFrame, boolean closedByServer) void
WebSocketListener.onDisconnected
(WebSocket websocket, WebSocketFrame serverCloseFrame, WebSocketFrame clientCloseFrame, boolean closedByServer) Called after the WebSocket connection was closed.void
WebSocketAdapter.onError
(WebSocket websocket, WebSocketException cause) void
WebSocketListener.onError
(WebSocket websocket, WebSocketException cause) Call when an error occurred.void
WebSocketAdapter.onFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onFrame
(WebSocket websocket, WebSocketFrame frame) Called when a frame was received.void
WebSocketAdapter.onFrameError
(WebSocket websocket, WebSocketException cause, WebSocketFrame frame) void
WebSocketListener.onFrameError
(WebSocket websocket, WebSocketException cause, WebSocketFrame frame) Called when a WebSocket frame failed to be read from the WebSocket.void
WebSocketAdapter.onFrameSent
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onFrameSent
(WebSocket websocket, WebSocketFrame frame) Called when a WebSocket frame was sent to the server (but not flushed yet).void
WebSocketAdapter.onFrameUnsent
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onFrameUnsent
(WebSocket websocket, WebSocketFrame frame) Called when a WebSocket frame was not sent to the server because a close frame has already been sent.void
WebSocketAdapter.onMessageDecompressionError
(WebSocket websocket, WebSocketException cause, byte[] compressed) void
WebSocketListener.onMessageDecompressionError
(WebSocket websocket, WebSocketException cause, byte[] compressed) Called when a message failed to be decompressed.void
WebSocketAdapter.onMessageError
(WebSocket websocket, WebSocketException cause, List<WebSocketFrame> frames) 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.onPingFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onPingFrame
(WebSocket websocket, WebSocketFrame frame) Called when a ping frame (opcode = 0x9) was received.void
WebSocketAdapter.onPongFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onPongFrame
(WebSocket websocket, WebSocketFrame frame) Called when a pong frame (opcode = 0xA) was received.void
WebSocketAdapter.onSendError
(WebSocket websocket, WebSocketException cause, 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.onSendingFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onSendingFrame
(WebSocket websocket, WebSocketFrame frame) Called before a WebSocket frame is sent.void
WebSocketAdapter.onSendingHandshake
(WebSocket websocket, String requestLine, List<String[]> headers) void
WebSocketListener.onSendingHandshake
(WebSocket websocket, String requestLine, List<String[]> headers) Called before an opening handshake is sent to the server.void
WebSocketAdapter.onStateChanged
(WebSocket websocket, WebSocketState newState) void
WebSocketListener.onStateChanged
(WebSocket websocket, WebSocketState newState) Called after the state of the WebSocket changed.void
WebSocketAdapter.onTextFrame
(WebSocket websocket, WebSocketFrame frame) void
WebSocketListener.onTextFrame
(WebSocket websocket, WebSocketFrame frame) Called when a text frame (opcode = 0x1) was received.void
WebSocketAdapter.onTextMessage
(WebSocket websocket, byte[] data) void
WebSocketAdapter.onTextMessage
(WebSocket websocket, String text) void
WebSocketListener.onTextMessage
(WebSocket websocket, byte[] data) Called when a text message was received instead ofWebSocketListener.onTextMessage(WebSocket, String)
whenisDirectTextMessage()
returnstrue
.void
WebSocketListener.onTextMessage
(WebSocket websocket, String text) Called when a text message was received.void
WebSocketAdapter.onTextMessageError
(WebSocket websocket, WebSocketException cause, byte[] data) void
WebSocketListener.onTextMessageError
(WebSocket websocket, WebSocketException cause, byte[] data) Called when it failed to convert payload data into a string.void
WebSocketAdapter.onThreadCreated
(WebSocket websocket, ThreadType threadType, Thread thread) void
WebSocketListener.onThreadCreated
(WebSocket websocket, ThreadType threadType, Thread thread) Called between after a thread is created and before the thread'sstart()
method is called.void
WebSocketAdapter.onThreadStarted
(WebSocket websocket, ThreadType threadType, Thread thread) void
WebSocketListener.onThreadStarted
(WebSocket websocket, ThreadType threadType, Thread thread) Called at the very beginning of the thread'srun()
method implementation.void
WebSocketAdapter.onThreadStopping
(WebSocket websocket, ThreadType threadType, Thread thread) void
WebSocketListener.onThreadStopping
(WebSocket websocket, ThreadType threadType, Thread thread) Called at the very end of the thread'srun()
method implementation.void
WebSocketAdapter.onUnexpectedError
(WebSocket websocket, WebSocketException cause) 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).Constructors in com.neovisionaries.ws.client with parameters of type WebSocketModifierConstructorDescriptionConnectable
(WebSocket ws) HandshakeReader
(WebSocket websocket) ListenerManager
(WebSocket websocket) PeriodicalFrameSender
(WebSocket webSocket, String timerName, PayloadGenerator generator) PingSender
(WebSocket webSocket, PayloadGenerator generator) PongSender
(WebSocket webSocket, PayloadGenerator generator) ReadingThread
(WebSocket websocket) (package private)
WebSocketThread
(String name, WebSocket ws, ThreadType type) WritingThread
(WebSocket websocket)