Interface WebSocket
-
- All Known Implementing Classes:
WebSocketImpl
public interface WebSocketProvides interface for WebSocket.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classWebSocket.WebSocketFrameReadStateStates for the web socket when reading from the underlying buffer.static classWebSocket.WebSocketStateStates that the web socket can be in.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconfigure(String host, String path, String query, int port, String protocol, Map<String,String> additionalHeaders, WebSocketHandler webSocketHandler)Configure WebSocket connection.BooleangetEnabled()Access if WebSocket enabled .ByteBuffergetInputBuffer()Access the input buffer (read only).ByteBuffergetOutputBuffer()Access the output buffer (read only).ByteBuffergetPingBuffer()Access the ping buffer (read only).WebSocket.WebSocketStategetState()Access the current state of the layer.WebSocketHandlergetWebSocketHandler()Access the handler for WebSocket functions.ByteBuffergetWsInputBuffer()Access the web socket input buffer (read only).WebSocketHandler.WebsocketTupleunwrapBuffer(ByteBuffer buffer)Remove WebSocket frame from the given buffer.voidwrapBuffer(ByteBuffer srcBuffer, ByteBuffer dstBuffer)Add WebSocket frame to send the given buffer.
-
-
-
Method Detail
-
configure
void configure(String host, String path, String query, int port, String protocol, Map<String,String> additionalHeaders, WebSocketHandler webSocketHandler)
Configure WebSocket connection.- Parameters:
host- the hots namepath- the resource pathquery- the queryport- the portprotocol- the base protocoladditionalHeaders- the Map of additional headerswebSocketHandler- the web socket handler
-
wrapBuffer
void wrapBuffer(ByteBuffer srcBuffer, ByteBuffer dstBuffer)
Add WebSocket frame to send the given buffer.- Parameters:
srcBuffer- the source bufferdstBuffer- the destination buffer
-
unwrapBuffer
WebSocketHandler.WebsocketTuple unwrapBuffer(ByteBuffer buffer)
Remove WebSocket frame from the given buffer.- Parameters:
buffer- the buffer to unwrap- Returns:
- The payload of the given WebSocket frame.
-
getWebSocketHandler
WebSocketHandler getWebSocketHandler()
Access the handler for WebSocket functions.- Returns:
- The WebSocket handler class.
-
getState
WebSocket.WebSocketState getState()
Access the current state of the layer.- Returns:
- The state of the WebSocket layer.
-
getEnabled
Boolean getEnabled()
Access if WebSocket enabled .- Returns:
- True if WebSocket enabled otherwise false.
-
getOutputBuffer
ByteBuffer getOutputBuffer()
Access the output buffer (read only).- Returns:
- The current output buffer.
-
getInputBuffer
ByteBuffer getInputBuffer()
Access the input buffer (read only).- Returns:
- The current input buffer.
-
getPingBuffer
ByteBuffer getPingBuffer()
Access the ping buffer (read only).- Returns:
- The ping input buffer.
-
getWsInputBuffer
ByteBuffer getWsInputBuffer()
Access the web socket input buffer (read only).- Returns:
- The wsInputBuffer input buffer.
-
-