Base WebSocket implementation.
It implements both and so it can be used with Pump to pump data with flow control.
no type hierarchy
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
binaryHandlerID | shared String binaryHandlerID() When a Given this ID, a different event loop can send a binary frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops. |
binaryMessageHandler | shared WebSocketBase binaryMessageHandler(Anything(Buffer)? handler) Set a binary message handler on the connection. This handler serves a similar purpose to handler except that if a message comes into the socket in multiple frames, the data from the frames will be aggregated into a single buffer before calling the handler (using isFinal to find the boundaries). Parameters:
|
close | shared void close() Close the WebSocket. |
closeHandler | shared WebSocketBase closeHandler(Anything()? handler) Set a close handler. This will be called when the WebSocket is closed. Parameters:
|
drainHandler | shared WebSocketBase drainHandler(Anything()? handler) |
end | shared void end() Calls close |
end | shared void end(Buffer t) Same as end but writes some data to the stream before ending. |
endHandler | shared WebSocketBase endHandler(Anything()? endHandler) |
exceptionHandler | shared WebSocketBase exceptionHandler(Anything(Throwable)? handler) |
frameHandler | shared WebSocketBase frameHandler(Anything(WebSocketFrame)? handler) Set a frame handler on the connection. This handler will be called when frames are read on the connection. Parameters:
|
handler | shared WebSocketBase handler(Anything(Buffer)? handler) |
isSsl | shared Boolean isSsl() |
localAddress | shared SocketAddress localAddress() |
pause | shared WebSocketBase pause() |
pongHandler | shared WebSocketBase pongHandler(Anything(Buffer)? handler) Set a pong message handler on the connection. This handler will be invoked every time a pong message is received on the server, and can be used by both clients and servers since the RFC 6455 Sections 5.5.2 and 5.5.3 do not specify whether the client or server sends a ping. Pong frames may be at most 125 bytes (octets). There is no ping handler since pings should immediately be responded to with a pong with identical content Pong frames may be received unsolicited. Parameters:
|
remoteAddress | shared SocketAddress remoteAddress() |
resume | shared WebSocketBase resume() |
setWriteQueueMaxSize | shared WebSocketBase setWriteQueueMaxSize(Integer maxSize) |
subProtocol | shared String subProtocol() Returns the websocket sub protocol selected by the websocket handshake. On the server, the value will benull when the handler receives the websocket callback as the
handshake will not be completed yet.
|
textHandlerID | shared String textHandlerID() When a Given this ID, a different event loop can send a text frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops. |
textMessageHandler | shared WebSocketBase textMessageHandler(Anything(String)? handler) Set a text message handler on the connection. This handler will be called similar to the , but the buffer will be converted to a String first Parameters:
|
write | shared WebSocketBase write(Buffer data) |
writeBinaryMessage | shared WebSocketBase writeBinaryMessage(Buffer data) Writes a (potentially large) piece of binary data to the connection. This data might be written as multiple frames if it exceeds the maximum WebSocket frame size. Parameters:
|
writeFinalBinaryFrame | shared WebSocketBase writeFinalBinaryFrame(Buffer data) Write a final WebSocket binary frame to the connection Parameters:
|
writeFinalTextFrame | shared WebSocketBase writeFinalTextFrame(String text) Write a final WebSocket text frame to the connection Parameters:
|
writeFrame | shared WebSocketBase writeFrame(WebSocketFrame frame) Write a WebSocket frame to the connection Parameters:
|
writePing | shared WebSocketBase writePing(Buffer data) Writes a ping to the connection. This will be written in a single frame. Ping frames may be at most 125 bytes (octets). This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section 5.5.2. There is no pingHandler because RFC 6455 section 5.5.2 clearly states that the only response to a ping is a pong with identical contents. Parameters:
|
writePong | shared WebSocketBase writePong(Buffer data) Writes a pong to the connection. This will be written in a single frame. Pong frames may be at most 125 bytes (octets). This method should not be used to write application data and should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section 5.5.2. There is no need to manually write a Pong, as the server and client both handle responding to a ping with a pong automatically and this is exposed to users.RFC 6455 Section 5.5.3 states that pongs may be sent unsolicited in order to implement a one way heartbeat. Parameters:
|
writeQueueFull | shared Boolean writeQueueFull() This will return |
writeTextMessage | shared WebSocketBase writeTextMessage(String text) Writes a (potentially large) piece of text data to the connection. This data might be written as multiple frames if it exceeds the maximum WebSocket frame size. Parameters:
|
Inherited Methods |
Methods inherited from: Object equals |
Methods inherited from: ReadStream<T> |
Methods inherited from: StreamBase |
Methods inherited from: WriteStream<T> |