Class WebSocketServerConfig
java.lang.Object
io.vertx.core.http.WebSocketServerConfig
WebSocket server configuration.
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddWebSocketSubProtocol(String subProtocol) Add a WebSocket sub-protocol to the list supported by the server.intintintbooleanbooleanbooleanbooleanbooleansetClosingTimeout(Duration closingTimeout) Set the amount of time a server WebSocket will wait until it closes the TCP connection after sending a close frame.setCompressionLevel(int compressionLevel) Set the WebSocket compression level.setMaxFrameSize(int maxFrameSize) Set the maximum WebSocket frames sizesetMaxMessageSize(int maxMessageSize) Set the maximum WebSocket message sizesetSubProtocols(List<String> subProtocols) Set the WebSocket list of sub-protocol supported by the server.setUseClientNoContext(boolean use) Set whether the WebSocketclient_no_context_takeoverparameter of the per-message deflate compression is used or supported.setUsePerFrameCompression(boolean use) Set whether the WebSocket per-frame deflate compression extension is used or supported.setUsePerMessageCompression(boolean use) Set whether the WebSocket per-message deflate compression extension is used or supported.setUseServerNoContext(boolean use) Set whether the WebSocketserver_no_context_takeoverparameter of the per-message deflate compression is used or supported.setUseUnmaskedFrames(boolean use) Set whether WebSocket unmasked frames are used or supported
-
Constructor Details
-
WebSocketServerConfig
public WebSocketServerConfig() -
WebSocketServerConfig
-
-
Method Details
-
addWebSocketSubProtocol
Add a WebSocket sub-protocol to the list supported by the server.- Parameters:
subProtocol- the sub-protocol to add- Returns:
- a reference to this, so the API can be used fluently
-
setSubProtocols
Set the WebSocket list of sub-protocol supported by the server.- Parameters:
subProtocols- comma separated list of sub-protocols- Returns:
- a reference to this, so the API can be used fluently
-
getSubProtocols
-
getClosingTimeout
- Returns:
- the amount of time (in seconds) a client WebSocket will wait until it closes TCP connection after receiving a close frame
-
setClosingTimeout
Set the amount of time a server WebSocket will wait until it closes the TCP connection after sending a close frame.When a server closes a WebSocket, it should wait the client close frame to close the TCP connection. This timeout will close the TCP connection on the server when it expires. When the TCP connection is closed receiving the close frame, the
WebSocket.exceptionHandler(Handler)instead of theWebSocket.endHandler(Handler)will be called.Set to
0Lcloses the TCP connection immediately after sending the close frame.Set to a negative value to disable it.
- Parameters:
closingTimeout- the duration of the timeout- Returns:
- a reference to this, so the API can be used fluently
-
getMaxFrameSize
public int getMaxFrameSize()- Returns:
- the maximum WebSocket frame size
-
setMaxFrameSize
Set the maximum WebSocket frames size- Parameters:
maxFrameSize- the maximum frame size in bytes.- Returns:
- a reference to this, so the API can be used fluently
-
getMaxMessageSize
public int getMaxMessageSize()- Returns:
- the maximum WebSocket message size
-
setMaxMessageSize
Set the maximum WebSocket message size- Parameters:
maxMessageSize- the maximum message size in bytes.- Returns:
- a reference to this, so the API can be used fluently
-
getUsePerFrameCompression
public boolean getUsePerFrameCompression()- Returns:
- whether the endpoint will send or accept the per-frame deflate compression extension
-
setUsePerFrameCompression
Set whether the WebSocket per-frame deflate compression extension is used or supported.- Parameters:
use- whether the per-frame deflate compression extension will be sent or accepted- Returns:
- a reference to this, so the API can be used fluently
-
getUsePerMessageCompression
public boolean getUsePerMessageCompression()- Returns:
- whether the endpoint will send or accept the per-frame deflate compression extension
-
setUsePerMessageCompression
Set whether the WebSocket per-message deflate compression extension is used or supported.- Parameters:
use- whether the per-frame deflate compression extension will be sent or accepted- Returns:
- a reference to this, so the API can be used fluently
-
getCompressionLevel
public int getCompressionLevel()- Returns:
- the current WebSocket deflate compression level
-
setCompressionLevel
Set the WebSocket compression level.- Parameters:
compressionLevel- the compression level- Returns:
- a reference to this, so the API can be used fluently
-
isUseUnmaskedFrames
public boolean isUseUnmaskedFrames()- Returns:
- whether WebSocket unmasked frames are used or supported
-
setUseUnmaskedFrames
Set whether WebSocket unmasked frames are used or supported- Parameters:
use- whether the masked frames are used or supported- Returns:
- a reference to this, so the API can be used fluently
-
getUseServerNoContext
public boolean getUseServerNoContext()- Returns:
- whether the WebSocket
server_no_context_takeoverparameter of the per-message deflate compression is used or supported.
-
setUseServerNoContext
Set whether the WebSocketserver_no_context_takeoverparameter of the per-message deflate compression is used or supported.- Parameters:
use- whether the WebSocketserver_no_context_takeoverparameter of the per-message deflate compression is used or supported.- Returns:
- a reference to this, so the API can be used fluently
-
getUseClientNoContext
public boolean getUseClientNoContext()- Returns:
- use whether the WebSocket
client_no_context_takeoverparameter of the per-message deflate compression is used or supported.
-
setUseClientNoContext
Set whether the WebSocketclient_no_context_takeoverparameter of the per-message deflate compression is used or supported.- Parameters:
use- whether the WebSocketclient_no_context_takeoverparameter of the per-message deflate compression is used or supported.- Returns:
- a reference to this, so the API can be used fluently
-