public abstract class AbstractReceiveListener extends Object implements org.xnio.ChannelListener<WebSocketChannel>
| Modifier and Type | Field | Description |
|---|---|---|
protected int |
countInWindow |
|
static int |
DEFAULT_WEB_SOCKETS_CONTROL_FRAME_SIZE |
Maximum control frame size: https://datatracker.ietf.org/doc/html/rfc6455#section-5.5
|
static int |
DEFAULT_WEB_SOCKETS_MAX_READ_FRAMES |
Default value for max read frames. -1 - unbounded.
|
static int |
DEFAULT_WEB_SOCKETS_MESSAGE_SIZE |
Default size of data frames. -1 - unbounded.
|
static int |
DEFAULT_WEB_SOCKETS_PING_MAX_PER_WINDOW |
Default numbers of acceptable pings per window.
|
static int |
DEFAULT_WEB_SOCKETS_PING_WINDOW |
Default length of websocket ping window in milliseconds.
|
protected int |
maxCountInWindow |
|
static String |
WEB_SOCKETS_MAX_READ_FRAMES_PROPERTY |
|
static String |
WEB_SOCKETS_PING_MAX_PER_WINDOW_PROPERTY |
Option controlling max pings count during window; Defaults to
UndertowOptions#DEFAULT_WEB_SOCKETS_PING_MAX_PER_WINDOW |
static String |
WEB_SOCKETS_PING_WINDOW_PROPERTY |
Option controlling ping window duration.
|
static String |
WEB_SOCKETS_SIZE_BINARY_PROPERTY |
Maximum size of BINARY message.
|
static String |
WEB_SOCKETS_SIZE_TEXT_PROPERTY |
Maximum size of TEXT message.
|
protected long |
windowLength |
|
protected long |
windowTStampThreshold |
| Constructor | Description |
|---|---|
AbstractReceiveListener() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
bufferFullMessage(StreamSourceFrameChannel messageChannel) |
Utility method that reads a full text or binary message, including all fragmented parts.
|
protected void |
countPing(WebSocketChannel channel) |
|
protected long |
getMaxBinaryBufferSize() |
|
protected long |
getMaxCloseBufferSize() |
|
protected long |
getMaxPingBufferSize() |
|
protected int |
getMaxPingsPerWindow() |
|
protected long |
getMaxPongBufferSize() |
|
protected long |
getMaxTextBufferSize() |
|
protected long |
getPingWindowLength() |
REturn sliding window length in milliseconds.
|
void |
handleEvent(WebSocketChannel channel) |
|
protected void |
onBinary(WebSocketChannel webSocketChannel,
StreamSourceFrameChannel messageChannel) |
|
protected void |
onClose(WebSocketChannel webSocketChannel,
StreamSourceFrameChannel channel) |
|
protected void |
onCloseMessage(CloseMessage cm,
WebSocketChannel channel) |
|
protected void |
onError(WebSocketChannel channel,
Throwable error) |
|
protected void |
onFullBinaryMessage(WebSocketChannel channel,
BufferedBinaryMessage message) |
|
protected void |
onFullCloseMessage(WebSocketChannel channel,
BufferedBinaryMessage message) |
|
protected void |
onFullPingMessage(WebSocketChannel channel,
BufferedBinaryMessage message) |
|
protected void |
onFullPongMessage(WebSocketChannel channel,
BufferedBinaryMessage message) |
|
protected void |
onFullTextMessage(WebSocketChannel channel,
BufferedTextMessage message) |
|
protected void |
onPing(WebSocketChannel webSocketChannel,
StreamSourceFrameChannel channel) |
|
protected void |
onPong(WebSocketChannel webSocketChannel,
StreamSourceFrameChannel messageChannel) |
|
protected void |
onText(WebSocketChannel webSocketChannel,
StreamSourceFrameChannel messageChannel) |
public static final String WEB_SOCKETS_MAX_READ_FRAMES_PROPERTY
public static final int DEFAULT_WEB_SOCKETS_MAX_READ_FRAMES
public static final int DEFAULT_WEB_SOCKETS_MESSAGE_SIZE
public static final int DEFAULT_WEB_SOCKETS_CONTROL_FRAME_SIZE
public static final String WEB_SOCKETS_SIZE_TEXT_PROPERTY
public static final String WEB_SOCKETS_SIZE_BINARY_PROPERTY
public static final int DEFAULT_WEB_SOCKETS_PING_MAX_PER_WINDOW
public static final String WEB_SOCKETS_PING_MAX_PER_WINDOW_PROPERTY
UndertowOptions#DEFAULT_WEB_SOCKETS_PING_MAX_PER_WINDOWpublic static final int DEFAULT_WEB_SOCKETS_PING_WINDOW
public static final String WEB_SOCKETS_PING_WINDOW_PROPERTY
UndertowOptions#DEFAULT_WEB_SOCKETS_PING_WINDOWprotected long windowLength
protected int countInWindow
protected int maxCountInWindow
protected long windowTStampThreshold
protected void countPing(WebSocketChannel channel) throws IOException
IOExceptionprotected long getMaxBinaryBufferSize()
protected final long getMaxPongBufferSize()
protected final long getMaxCloseBufferSize()
protected final long getMaxPingBufferSize()
protected long getMaxTextBufferSize()
protected int getMaxPingsPerWindow()
protected long getPingWindowLength()
public void handleEvent(WebSocketChannel channel)
handleEvent in interface org.xnio.ChannelListener<WebSocketChannel>protected void onPing(WebSocketChannel webSocketChannel, StreamSourceFrameChannel channel) throws IOException
IOExceptionprotected void onClose(WebSocketChannel webSocketChannel, StreamSourceFrameChannel channel) throws IOException
IOExceptionprotected void onPong(WebSocketChannel webSocketChannel, StreamSourceFrameChannel messageChannel) throws IOException
IOExceptionprotected void onText(WebSocketChannel webSocketChannel, StreamSourceFrameChannel messageChannel) throws IOException
IOExceptionprotected void onBinary(WebSocketChannel webSocketChannel, StreamSourceFrameChannel messageChannel) throws IOException
IOExceptionprotected void onError(WebSocketChannel channel, Throwable error)
protected final void bufferFullMessage(StreamSourceFrameChannel messageChannel)
onFullTextMessage(WebSocketChannel, BufferedTextMessage) or
onFullBinaryMessage(WebSocketChannel, BufferedBinaryMessage) method will be invoked.messageChannel - The message channelprotected void onFullTextMessage(WebSocketChannel channel, BufferedTextMessage message) throws IOException
IOExceptionprotected void onFullBinaryMessage(WebSocketChannel channel, BufferedBinaryMessage message) throws IOException
IOExceptionprotected void onFullPingMessage(WebSocketChannel channel, BufferedBinaryMessage message) throws IOException
IOExceptionprotected void onFullPongMessage(WebSocketChannel channel, BufferedBinaryMessage message) throws IOException
IOExceptionprotected void onFullCloseMessage(WebSocketChannel channel, BufferedBinaryMessage message) throws IOException
IOExceptionprotected void onCloseMessage(CloseMessage cm, WebSocketChannel channel)
Copyright © 2026 JBoss by Red Hat. All rights reserved.