Top Description Methods
org.eclipse.jetty.websocket.api

public Interface Configurable

Known Direct Subinterfaces
org.eclipse.jetty.websocket.api.Session
Imports
java.time.Duration

Implementations allow to configure WebSocket parameters.

Method Summary

Modifier and TypeMethod and Description
public Duration

Returns:

the timeout duration
getIdleTimeout
()

The duration that a websocket may be idle before being closed by the implementation

public int

Returns:

the raw network buffer input size.
getInputBufferSize
()

The input (read from network layer) buffer size.

public long

Returns:

the maximum size of a binary message
getMaxBinaryMessageSize
()

Get the maximum size of a binary message during parsing.

public long

Returns:

the maximum size of a WebSocket Frame.
getMaxFrameSize
()

The maximum payload size of any WebSocket Frame which can be received.

public int

Returns:

the max number of frames.
getMaxOutgoingFrames
()

Get the maximum number of data frames allowed to be waiting to be sent at any one time.

public long

Returns:

the maximum size of a text message.
getMaxTextMessageSize
()

Get the maximum size of a text message during parsing.

public int

Returns:

the raw network buffer output size.
getOutputBufferSize
()

The output (write to network layer) buffer size.

public boolean

Returns:

whether to automatically fragment incoming WebSocket Frames.
isAutoFragment
()

If true, frames are automatically fragmented to respect the maximum frame size.

public void
setAutoFragment(boolean
whether to automatically fragment incoming WebSocket Frames.
autoFragment
)

If set to true, frames are automatically fragmented to respect the maximum frame size.

public void
setIdleTimeout(Duration
the timeout duration (may not be null or negative)
duration
)

The duration that a websocket may be idle before being closed by the implementation

public void
setInputBufferSize(int
the size in bytes
size
)

The input (read from network layer) buffer size.

public void
setMaxBinaryMessageSize(long
the maximum allowed size of a binary message.
size
)

The maximum size of a binary message during parsing/generating.

public void
setMaxFrameSize(long
the maximum allowed size of a WebSocket Frame.
maxFrameSize
)

The maximum payload size of any WebSocket Frame which can be received.

public void
setMaxOutgoingFrames(int
the max number of frames.
maxOutgoingFrames
)

Set the maximum number of data frames allowed to be waiting to be sent at any one time.

public void
setMaxTextMessageSize(long
the maximum allowed size of a text message.
size
)

The maximum size of a text message during parsing/generating.

public void
setOutputBufferSize(int
the size in bytes
size
)

The output (write to network layer) buffer size.

Method Detail

getIdleTimeoutback to summary
public Duration getIdleTimeout()

The duration that a websocket may be idle before being closed by the implementation

Returns:Duration

the timeout duration

getInputBufferSizeback to summary
public int getInputBufferSize()

The input (read from network layer) buffer size.

This is the raw read operation buffer size, before the parsing of the websocket frames.

Returns:int

the raw network buffer input size.

getMaxBinaryMessageSizeback to summary
public long getMaxBinaryMessageSize()

Get the maximum size of a binary message during parsing.

This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling binary messages. This applies to individual frames, whole message handling, and partial message handling.

Binary messages over this maximum will result in a close code 1009 StatusCode#MESSAGE_TOO_LARGE

Returns:long

the maximum size of a binary message

getMaxFrameSizeback to summary
public long getMaxFrameSize()

The maximum payload size of any WebSocket Frame which can be received.

Returns:long

the maximum size of a WebSocket Frame.

getMaxOutgoingFramesback to summary
public int getMaxOutgoingFrames()

Get the maximum number of data frames allowed to be waiting to be sent at any one time. The default value is -1, this indicates there is no limit on how many frames can be queued to be sent by the implementation. If the limit is exceeded, subsequent frames sent are failed with a java.nio.channels.WritePendingException but the connection is not failed and will remain open.

Returns:int

the max number of frames.

getMaxTextMessageSizeback to summary
public long getMaxTextMessageSize()

Get the maximum size of a text message during parsing.

This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling text messages. This applies to individual frames, whole message handling, and partial message handling.

Text messages over this maximum will result in a close code 1009 StatusCode#MESSAGE_TOO_LARGE

Returns:long

the maximum size of a text message.

getOutputBufferSizeback to summary
public int getOutputBufferSize()

The output (write to network layer) buffer size.

This is the raw write operation buffer size and has no relationship to the websocket frame.

Returns:int

the raw network buffer output size.

isAutoFragmentback to summary
public boolean isAutoFragment()

If true, frames are automatically fragmented to respect the maximum frame size.

Returns:boolean

whether to automatically fragment incoming WebSocket Frames.

setAutoFragmentback to summary
public void setAutoFragment(boolean autoFragment)

If set to true, frames are automatically fragmented to respect the maximum frame size.

Parameters
autoFragment:boolean

whether to automatically fragment incoming WebSocket Frames.

setIdleTimeoutback to summary
public void setIdleTimeout(Duration duration)

The duration that a websocket may be idle before being closed by the implementation

Parameters
duration:Duration

the timeout duration (may not be null or negative)

setInputBufferSizeback to summary
public void setInputBufferSize(int size)

The input (read from network layer) buffer size.

Parameters
size:int

the size in bytes

setMaxBinaryMessageSizeback to summary
public void setMaxBinaryMessageSize(long size)

The maximum size of a binary message during parsing/generating.

Binary messages over this maximum will result in a close code 1009 StatusCode#MESSAGE_TOO_LARGE

Parameters
size:long

the maximum allowed size of a binary message.

setMaxFrameSizeback to summary
public void setMaxFrameSize(long maxFrameSize)

The maximum payload size of any WebSocket Frame which can be received.

WebSocket Frames over this maximum will result in a close code 1009 StatusCode#MESSAGE_TOO_LARGE

Parameters
maxFrameSize:long

the maximum allowed size of a WebSocket Frame.

setMaxOutgoingFramesback to summary
public void setMaxOutgoingFrames(int maxOutgoingFrames)

Set the maximum number of data frames allowed to be waiting to be sent at any one time. The default value is -1, this indicates there is no limit on how many frames can be queued to be sent by the implementation. If the limit is exceeded, subsequent frames sent are failed with a java.nio.channels.WritePendingException but the connection is not failed and will remain open.

Parameters
maxOutgoingFrames:int

the max number of frames.

setMaxTextMessageSizeback to summary
public void setMaxTextMessageSize(long size)

The maximum size of a text message during parsing/generating.

Text messages over this maximum will result in a close code 1009 StatusCode#MESSAGE_TOO_LARGE

Parameters
size:long

the maximum allowed size of a text message.

setOutputBufferSizeback to summary
public void setOutputBufferSize(int size)

The output (write to network layer) buffer size.

Parameters
size:int

the size in bytes