Uses of Interface
org.java_websocket.WebSocket
-
Packages that use WebSocket Package Description org.java_websocket org.java_websocket.client This package encapsulates all implementations in relation with the WebSocketClient.org.java_websocket.exceptions This package encapsulates all implementations in relation with the exceptions thrown in this lib.org.java_websocket.server This package encapsulates all implementations in relation with the WebSocketServer. -
-
Uses of WebSocket in org.java_websocket
Classes in org.java_websocket that implement WebSocket Modifier and Type Class Description class
WebSocketImpl
Represents one end (client or server) of a single WebSocketImpl connection.Methods in org.java_websocket that return WebSocket Modifier and Type Method Description WebSocket
WebSocketFactory. createWebSocket(WebSocketAdapter a, java.util.List<Draft> drafts)
Create a new Websocket with the provided listener, drafts and socketWebSocket
WebSocketFactory. createWebSocket(WebSocketAdapter a, Draft d)
Create a new Websocket with the provided listener, drafts and socketMethods in org.java_websocket that return types with arguments of type WebSocket Modifier and Type Method Description protected abstract java.util.Collection<WebSocket>
AbstractWebSocket. getConnections()
Getter to get all the currently available connectionsMethods in org.java_websocket with parameters of type WebSocket Modifier and Type Method Description private void
AbstractWebSocket. executeConnectionLostDetection(WebSocket webSocket, long minimumPongTime)
Send a ping to the endpoint or close the connection since the other endpoint did not respond with a pingjava.net.InetSocketAddress
WebSocketListener. getLocalSocketAddress(WebSocket conn)
java.net.InetSocketAddress
WebSocketListener. getRemoteSocketAddress(WebSocket conn)
PingFrame
WebSocketAdapter. onPreparePing(WebSocket conn)
Default implementation for onPreparePing, returns a (cached) PingFrame that has no application data.PingFrame
WebSocketListener. onPreparePing(WebSocket conn)
Called just before a ping frame is sent, in order to allow users to customize their ping frame data.void
WebSocketListener. onWebsocketClose(WebSocket ws, int code, java.lang.String reason, boolean remote)
Called after WebSocket#close is explicity called, or when the other end of the WebSocket connection is closed.void
WebSocketListener. onWebsocketCloseInitiated(WebSocket ws, int code, java.lang.String reason)
send when this peer sends a close handshakevoid
WebSocketListener. onWebsocketClosing(WebSocket ws, int code, java.lang.String reason, boolean remote)
Called as soon as no further frames are acceptedvoid
WebSocketListener. onWebsocketError(WebSocket conn, java.lang.Exception ex)
Called if an exception worth noting occurred.void
WebSocketAdapter. onWebsocketHandshakeReceivedAsClient(WebSocket conn, ClientHandshake request, ServerHandshake response)
void
WebSocketListener. onWebsocketHandshakeReceivedAsClient(WebSocket conn, ClientHandshake request, ServerHandshake response)
Called on the client side when the socket connection is first established, and the WebSocketImpl handshake response has been received.ServerHandshakeBuilder
WebSocketAdapter. onWebsocketHandshakeReceivedAsServer(WebSocket conn, Draft draft, ClientHandshake request)
This default implementation does not do anything.ServerHandshakeBuilder
WebSocketListener. onWebsocketHandshakeReceivedAsServer(WebSocket conn, Draft draft, ClientHandshake request)
Called on the server side when the socket connection is first established, and the WebSocket handshake has been received.void
WebSocketAdapter. onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request)
This default implementation does not do anything which will cause the connections to always progress.void
WebSocketListener. onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request)
Called on the client side when the socket connection is first established, and the WebSocketImpl handshake has just been sent.void
WebSocketListener. onWebsocketMessage(WebSocket conn, java.lang.String message)
Called when an entire text frame has been received.void
WebSocketListener. onWebsocketMessage(WebSocket conn, java.nio.ByteBuffer blob)
Called when an entire binary frame has been received.void
WebSocketListener. onWebsocketOpen(WebSocket conn, Handshakedata d)
Called after onHandshakeReceived returns true.void
WebSocketAdapter. onWebsocketPing(WebSocket conn, Framedata f)
This default implementation will send a pong in response to the received ping.void
WebSocketListener. onWebsocketPing(WebSocket conn, Framedata f)
Called a ping frame has been received.void
WebSocketAdapter. onWebsocketPong(WebSocket conn, Framedata f)
This default implementation does not do anything.void
WebSocketListener. onWebsocketPong(WebSocket conn, Framedata f)
Called when a pong frame is received.void
WebSocketListener. onWriteDemand(WebSocket conn)
This method is used to inform the selector thread that there is data queued to be written to the socket. -
Uses of WebSocket in org.java_websocket.client
Classes in org.java_websocket.client that implement WebSocket Modifier and Type Class Description class
WebSocketClient
A subclass must implement at least onOpen, onClose, and onMessage to be useful.Methods in org.java_websocket.client that return WebSocket Modifier and Type Method Description WebSocket
WebSocketClient. getConnection()
Getter for the engineMethods in org.java_websocket.client that return types with arguments of type WebSocket Modifier and Type Method Description protected java.util.Collection<WebSocket>
WebSocketClient. getConnections()
Methods in org.java_websocket.client with parameters of type WebSocket Modifier and Type Method Description java.net.InetSocketAddress
WebSocketClient. getLocalSocketAddress(WebSocket conn)
java.net.InetSocketAddress
WebSocketClient. getRemoteSocketAddress(WebSocket conn)
void
WebSocketClient. onWebsocketClose(WebSocket conn, int code, java.lang.String reason, boolean remote)
Calls subclass' implementation of onClose.void
WebSocketClient. onWebsocketCloseInitiated(WebSocket conn, int code, java.lang.String reason)
void
WebSocketClient. onWebsocketClosing(WebSocket conn, int code, java.lang.String reason, boolean remote)
void
WebSocketClient. onWebsocketError(WebSocket conn, java.lang.Exception ex)
Calls subclass' implementation of onIOError.void
WebSocketClient. onWebsocketMessage(WebSocket conn, java.lang.String message)
Calls subclass' implementation of onMessage.void
WebSocketClient. onWebsocketMessage(WebSocket conn, java.nio.ByteBuffer blob)
void
WebSocketClient. onWebsocketOpen(WebSocket conn, Handshakedata handshake)
Calls subclass' implementation of onOpen.void
WebSocketClient. onWriteDemand(WebSocket conn)
-
Uses of WebSocket in org.java_websocket.exceptions
Fields in org.java_websocket.exceptions declared as WebSocket Modifier and Type Field Description private WebSocket
WrappedIOException. connection
The websocket where the IOException happenedMethods in org.java_websocket.exceptions that return WebSocket Modifier and Type Method Description WebSocket
WrappedIOException. getConnection()
The websocket where the IOException happenedConstructors in org.java_websocket.exceptions with parameters of type WebSocket Constructor Description WrappedIOException(WebSocket connection, java.io.IOException ioException)
Wrapp an IOException and include the websocket -
Uses of WebSocket in org.java_websocket.server
Fields in org.java_websocket.server with type parameters of type WebSocket Modifier and Type Field Description private java.util.Collection<WebSocket>
WebSocketServer. connections
Holds the list of active WebSocket connections.Methods in org.java_websocket.server that return types with arguments of type WebSocket Modifier and Type Method Description java.util.Collection<WebSocket>
WebSocketServer. getConnections()
Returns all currently connected clients.Methods in org.java_websocket.server with parameters of type WebSocket Modifier and Type Method Description protected boolean
WebSocketServer. addConnection(WebSocket ws)
protected void
WebSocketServer. allocateBuffers(WebSocket c)
java.net.InetSocketAddress
WebSocketServer. getLocalSocketAddress(WebSocket conn)
java.net.InetSocketAddress
WebSocketServer. getRemoteSocketAddress(WebSocket conn)
private java.net.Socket
WebSocketServer. getSocket(WebSocket conn)
Getter to return the socket used by this specific connectionprivate void
WebSocketServer. handleFatal(WebSocket conn, java.lang.Exception e)
private void
WebSocketServer. handleIOException(java.nio.channels.SelectionKey key, WebSocket conn, java.io.IOException ex)
abstract void
WebSocketServer. onClose(WebSocket conn, int code, java.lang.String reason, boolean remote)
Called after the websocket connection has been closed.void
WebSocketServer. onCloseInitiated(WebSocket conn, int code, java.lang.String reason)
void
WebSocketServer. onClosing(WebSocket conn, int code, java.lang.String reason, boolean remote)
abstract void
WebSocketServer. onError(WebSocket conn, java.lang.Exception ex)
Called when errors occurs.abstract void
WebSocketServer. onMessage(WebSocket conn, java.lang.String message)
Callback for string messages received from the remote hostvoid
WebSocketServer. onMessage(WebSocket conn, java.nio.ByteBuffer message)
Callback for binary messages received from the remote hostabstract void
WebSocketServer. onOpen(WebSocket conn, ClientHandshake handshake)
Called after an opening handshake has been performed and the given websocket is ready to be written on.void
WebSocketServer. onWebsocketClose(WebSocket conn, int code, java.lang.String reason, boolean remote)
void
WebSocketServer. onWebsocketCloseInitiated(WebSocket conn, int code, java.lang.String reason)
void
WebSocketServer. onWebsocketClosing(WebSocket conn, int code, java.lang.String reason, boolean remote)
void
WebSocketServer. onWebsocketError(WebSocket conn, java.lang.Exception ex)
void
WebSocketServer. onWebsocketMessage(WebSocket conn, java.lang.String message)
void
WebSocketServer. onWebsocketMessage(WebSocket conn, java.nio.ByteBuffer blob)
void
WebSocketServer. onWebsocketOpen(WebSocket conn, Handshakedata handshake)
void
WebSocketServer. onWriteDemand(WebSocket w)
protected void
WebSocketServer. releaseBuffers(WebSocket c)
protected boolean
WebSocketServer. removeConnection(WebSocket ws)
This method performs remove operations on the connection and therefore also gives control over whether the operation shall be synchronizedMethod parameters in org.java_websocket.server with type arguments of type WebSocket Modifier and Type Method Description void
WebSocketServer. broadcast(byte[] data, java.util.Collection<WebSocket> clients)
Send a byte array to a specific collection of websocket connectionsvoid
WebSocketServer. broadcast(java.lang.String text, java.util.Collection<WebSocket> clients)
Send a text to a specific collection of websocket connectionsvoid
WebSocketServer. broadcast(java.nio.ByteBuffer data, java.util.Collection<WebSocket> clients)
Send a ByteBuffer to a specific collection of websocket connectionsprivate void
WebSocketServer. doBroadcast(java.lang.Object data, java.util.Collection<WebSocket> clients)
Private method to cache all the frames to improve memory footprint and conversion timeConstructor parameters in org.java_websocket.server with type arguments of type WebSocket Constructor Description WebSocketServer(java.net.InetSocketAddress address, int decodercount, java.util.List<Draft> drafts, java.util.Collection<WebSocket> connectionscontainer)
Creates a WebSocketServer that will attempt to bind/listen on the given address, and comply with Draft version draft.
-