Uses of Interface
org.java_websocket.WebSocket
Packages that use WebSocket
Package
Description
This package encapsulates all implementations in relation with the WebSocketClient.
This package encapsulates all implementations in relation with the exceptions thrown in this
lib.
This package encapsulates all implementations in relation with the WebSocketServer.
-
Uses of WebSocket in org.java_websocket
Classes in org.java_websocket that implement WebSocketModifier and TypeClassDescriptionclass
Represents one end (client or server) of a single WebSocketImpl connection.Methods in org.java_websocket that return WebSocketModifier and TypeMethodDescriptionWebSocketFactory.createWebSocket
(WebSocketAdapter a, List<Draft> drafts) Create a new Websocket with the provided listener, drafts and socketWebSocketFactory.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 WebSocketModifier and TypeMethodDescriptionprotected abstract Collection<WebSocket>
AbstractWebSocket.getConnections()
Getter to get all the currently available connectionsMethods in org.java_websocket with parameters of type WebSocketModifier and TypeMethodDescriptionWebSocketListener.getLocalSocketAddress
(WebSocket conn) WebSocketListener.getRemoteSocketAddress
(WebSocket conn) WebSocketAdapter.onPreparePing
(WebSocket conn) Default implementation for onPreparePing, returns a (cached) PingFrame that has no application data.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, 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, String reason) send when this peer sends a close handshakevoid
WebSocketListener.onWebsocketClosing
(WebSocket ws, int code, String reason, boolean remote) Called as soon as no further frames are acceptedvoid
WebSocketListener.onWebsocketError
(WebSocket conn, 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.WebSocketAdapter.onWebsocketHandshakeReceivedAsServer
(WebSocket conn, Draft draft, ClientHandshake request) This default implementation does not do anything.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, String message) Called when an entire text frame has been received.void
WebSocketListener.onWebsocketMessage
(WebSocket conn, 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 WebSocketModifier and TypeClassDescriptionclass
A subclass must implement at least onOpen, onClose, and onMessage to be useful.Methods in org.java_websocket.client that return WebSocketMethods in org.java_websocket.client that return types with arguments of type WebSocketModifier and TypeMethodDescriptionprotected Collection<WebSocket>
WebSocketClient.getConnections()
Methods in org.java_websocket.client with parameters of type WebSocketModifier and TypeMethodDescriptionWebSocketClient.getLocalSocketAddress
(WebSocket conn) WebSocketClient.getRemoteSocketAddress
(WebSocket conn) final void
WebSocketClient.onWebsocketClose
(WebSocket conn, int code, String reason, boolean remote) Calls subclass' implementation of onClose.void
WebSocketClient.onWebsocketCloseInitiated
(WebSocket conn, int code, String reason) void
WebSocketClient.onWebsocketClosing
(WebSocket conn, int code, String reason, boolean remote) final void
WebSocketClient.onWebsocketError
(WebSocket conn, Exception ex) Calls subclass' implementation of onIOError.final void
WebSocketClient.onWebsocketMessage
(WebSocket conn, String message) Calls subclass' implementation of onMessage.final void
WebSocketClient.onWebsocketMessage
(WebSocket conn, ByteBuffer blob) final void
WebSocketClient.onWebsocketOpen
(WebSocket conn, Handshakedata handshake) Calls subclass' implementation of onOpen.final void
WebSocketClient.onWriteDemand
(WebSocket conn) -
Uses of WebSocket in org.java_websocket.exceptions
Methods in org.java_websocket.exceptions that return WebSocketModifier and TypeMethodDescriptionWrappedIOException.getConnection()
The websocket where the IOException happenedConstructors in org.java_websocket.exceptions with parameters of type WebSocketModifierConstructorDescriptionWrappedIOException
(WebSocket connection, IOException ioException) Wrapp an IOException and include the websocket -
Uses of WebSocket in org.java_websocket.server
Methods in org.java_websocket.server that return types with arguments of type WebSocketModifier and TypeMethodDescriptionWebSocketServer.getConnections()
Returns all currently connected clients.Methods in org.java_websocket.server with parameters of type WebSocketModifier and TypeMethodDescriptionprotected boolean
WebSocketServer.addConnection
(WebSocket ws) protected void
WebSocketServer.allocateBuffers
(WebSocket c) WebSocketServer.getLocalSocketAddress
(WebSocket conn) WebSocketServer.getRemoteSocketAddress
(WebSocket conn) abstract void
Called after the websocket connection has been closed.void
WebSocketServer.onCloseInitiated
(WebSocket conn, int code, String reason) void
abstract void
Called when errors occurs.abstract void
Callback for string messages received from the remote hostvoid
WebSocketServer.onMessage
(WebSocket conn, 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.final void
WebSocketServer.onWebsocketClose
(WebSocket conn, int code, String reason, boolean remote) void
WebSocketServer.onWebsocketCloseInitiated
(WebSocket conn, int code, String reason) void
WebSocketServer.onWebsocketClosing
(WebSocket conn, int code, String reason, boolean remote) final void
WebSocketServer.onWebsocketError
(WebSocket conn, Exception ex) final void
WebSocketServer.onWebsocketMessage
(WebSocket conn, String message) final void
WebSocketServer.onWebsocketMessage
(WebSocket conn, ByteBuffer blob) final void
WebSocketServer.onWebsocketOpen
(WebSocket conn, Handshakedata handshake) final 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 WebSocketModifier and TypeMethodDescriptionvoid
WebSocketServer.broadcast
(byte[] data, Collection<WebSocket> clients) Send a byte array to a specific collection of websocket connectionsvoid
WebSocketServer.broadcast
(String text, Collection<WebSocket> clients) Send a text to a specific collection of websocket connectionsvoid
WebSocketServer.broadcast
(ByteBuffer data, Collection<WebSocket> clients) Send a ByteBuffer to a specific collection of websocket connectionsConstructor parameters in org.java_websocket.server with type arguments of type WebSocketModifierConstructorDescriptionWebSocketServer
(InetSocketAddress address, int decodercount, List<Draft> drafts, Collection<WebSocket> connectionscontainer) Creates a WebSocketServer that will attempt to bind/listen on the given address, and comply with Draft version draft.