接口 SockJsServiceConfig
public interface SockJsServiceConfig
Provides transport handling code with access to theSockJsService
configuration options they need to have access to. Mainly for internal use.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 long
getHeartbeatTime()
The amount of time in milliseconds when the server has not sent any messages and after which the server should send a heartbeat frame to the client in order to keep the connection from breaking.int
getHttpMessageCacheSize()
The number of server-to-client messages that a session can cache while waiting for the next HTTP polling request from the client.SockJsMessageCodec
getMessageCodec()
The codec to use for encoding and decoding SockJS messages.int
getStreamBytesLimit()
Streaming transports save responses on the client side and don't free memory used by delivered messages.TaskScheduler
getTaskScheduler()
A scheduler instance to use for scheduling heart-beat messages.
方法详细资料
getTaskScheduler
TaskScheduler getTaskScheduler()
A scheduler instance to use for scheduling heart-beat messages.
getStreamBytesLimit
int getStreamBytesLimit()
Streaming transports save responses on the client side and don't free memory used by delivered messages. Such transports need to recycle the connection once in a while. This property sets a minimum number of bytes that can be send over a single HTTP streaming request before it will be closed. After that client will open a new request. Setting this value to one effectively disables streaming and will make streaming transports to behave like polling transports.The default value is 128K (i.e. 128 * 1024).
getHeartbeatTime
long getHeartbeatTime()
The amount of time in milliseconds when the server has not sent any messages and after which the server should send a heartbeat frame to the client in order to keep the connection from breaking.The default value is 25,000 (25 seconds).
getHttpMessageCacheSize
int getHttpMessageCacheSize()
The number of server-to-client messages that a session can cache while waiting for the next HTTP polling request from the client. All HTTP transports use this property since even streaming transports recycle HTTP requests periodically.The amount of time between HTTP requests should be relatively brief and will not exceed the allows disconnect delay (see
AbstractSockJsService.setDisconnectDelay(long)
, 5 seconds by default.The default size is 100.
getMessageCodec
SockJsMessageCodec getMessageCodec()
The codec to use for encoding and decoding SockJS messages.- 抛出:
IllegalStateException
- if noSockJsMessageCodec
is available