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 TypeClassDescriptionclassRepresents 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.voidWebSocketListener.onWebsocketClose(WebSocket ws, int code, String reason, boolean remote) Called afterWebSocket#closeis explicity called, or when the other end of the WebSocket connection is closed.voidWebSocketListener.onWebsocketCloseInitiated(WebSocket ws, int code, String reason) send when this peer sends a close handshakevoidWebSocketListener.onWebsocketClosing(WebSocket ws, int code, String reason, boolean remote) Called as soon as no further frames are acceptedvoidWebSocketListener.onWebsocketError(WebSocket conn, Exception ex) Called if an exception worth noting occurred.voidWebSocketAdapter.onWebsocketHandshakeReceivedAsClient(WebSocket conn, ClientHandshake request, ServerHandshake response) voidWebSocketListener.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.voidWebSocketAdapter.onWebsocketHandshakeSentAsClient(WebSocket conn, ClientHandshake request) This default implementation does not do anything which will cause the connections to always progress.voidWebSocketListener.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.voidWebSocketListener.onWebsocketMessage(WebSocket conn, String message) Called when an entire text frame has been received.voidWebSocketListener.onWebsocketMessage(WebSocket conn, ByteBuffer blob) Called when an entire binary frame has been received.voidWebSocketListener.onWebsocketOpen(WebSocket conn, Handshakedata d) Called after onHandshakeReceived returns true.voidWebSocketAdapter.onWebsocketPing(WebSocket conn, Framedata f) This default implementation will send a pong in response to the received ping.voidWebSocketListener.onWebsocketPing(WebSocket conn, Framedata f) Called a ping frame has been received.voidWebSocketAdapter.onWebsocketPong(WebSocket conn, Framedata f) This default implementation does not do anything.voidWebSocketListener.onWebsocketPong(WebSocket conn, Framedata f) Called when a pong frame is received.voidWebSocketListener.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 TypeClassDescriptionclassA 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 voidWebSocketClient.onWebsocketClose(WebSocket conn, int code, String reason, boolean remote) Calls subclass' implementation of onClose.voidWebSocketClient.onWebsocketCloseInitiated(WebSocket conn, int code, String reason) voidWebSocketClient.onWebsocketClosing(WebSocket conn, int code, String reason, boolean remote) final voidWebSocketClient.onWebsocketError(WebSocket conn, Exception ex) Calls subclass' implementation of onIOError.final voidWebSocketClient.onWebsocketMessage(WebSocket conn, String message) Calls subclass' implementation of onMessage.final voidWebSocketClient.onWebsocketMessage(WebSocket conn, ByteBuffer blob) final voidWebSocketClient.onWebsocketOpen(WebSocket conn, Handshakedata handshake) Calls subclass' implementation of onOpen.final voidWebSocketClient.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 booleanWebSocketServer.addConnection(WebSocket ws) protected voidWebSocketServer.allocateBuffers(WebSocket c) WebSocketServer.getLocalSocketAddress(WebSocket conn) WebSocketServer.getRemoteSocketAddress(WebSocket conn) abstract voidCalled after the websocket connection has been closed.voidWebSocketServer.onCloseInitiated(WebSocket conn, int code, String reason) voidabstract voidCalled when errors occurs.abstract voidCallback for string messages received from the remote hostvoidWebSocketServer.onMessage(WebSocket conn, ByteBuffer message) Callback for binary messages received from the remote hostabstract voidWebSocketServer.onOpen(WebSocket conn, ClientHandshake handshake) Called after an opening handshake has been performed and the given websocket is ready to be written on.final voidWebSocketServer.onWebsocketClose(WebSocket conn, int code, String reason, boolean remote) voidWebSocketServer.onWebsocketCloseInitiated(WebSocket conn, int code, String reason) voidWebSocketServer.onWebsocketClosing(WebSocket conn, int code, String reason, boolean remote) final voidWebSocketServer.onWebsocketError(WebSocket conn, Exception ex) final voidWebSocketServer.onWebsocketMessage(WebSocket conn, String message) final voidWebSocketServer.onWebsocketMessage(WebSocket conn, ByteBuffer blob) final voidWebSocketServer.onWebsocketOpen(WebSocket conn, Handshakedata handshake) final voidWebSocketServer.onWriteDemand(WebSocket w) protected voidWebSocketServer.releaseBuffers(WebSocket c) protected booleanWebSocketServer.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 TypeMethodDescriptionvoidWebSocketServer.broadcast(byte[] data, Collection<WebSocket> clients) Send a byte array to a specific collection of websocket connectionsvoidWebSocketServer.broadcast(String text, Collection<WebSocket> clients) Send a text to a specific collection of websocket connectionsvoidWebSocketServer.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 withDraftversion draft.