public class StreamingSockJsSession extends AbstractHttpSockJsSession
Modifier and Type | Field and Description |
---|---|
private int |
byteCount |
DISCONNECTED_CLIENT_LOG_CATEGORY, disconnectedClientLogger, logger
Constructor and Description |
---|
StreamingSockJsSession(java.lang.String sessionId,
SockJsServiceConfig config,
WebSocketHandler wsHandler,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Modifier and Type | Method and Description |
---|---|
protected void |
flushCache()
Only called if the connection is currently active
|
void |
handleInitialRequest(ServerHttpRequest request,
ServerHttpResponse response,
SockJsFrameFormat frameFormat)
Handle the first HTTP request, i.e.
|
protected void |
resetRequest() |
protected void |
writeFrameInternal(SockJsFrame frame) |
disconnect, getAcceptedProtocol, getBinaryMessageSizeLimit, getExtensions, getHandshakeHeaders, getLocalAddress, getMessageCache, getPrincipal, getRemoteAddress, getResponse, getTextMessageSizeLimit, getUri, handleSuccessiveRequest, isActive, sendMessageInternal, setAcceptedProtocol, setBinaryMessageSizeLimit, setTextMessageSizeLimit, startAsyncRequest, writePrelude
cancelHeartbeat, close, close, delegateConnectionClosed, delegateConnectionEstablished, delegateError, delegateMessages, disableHeartbeat, getAttributes, getId, getSockJsServiceConfig, getTimeSinceLastActive, isClosed, isNew, isOpen, scheduleHeartbeat, sendHeartbeat, sendMessage, toString, tryCloseWithSockJsTransportError, updateLastActiveTime, writeFrame
public StreamingSockJsSession(java.lang.String sessionId, SockJsServiceConfig config, WebSocketHandler wsHandler, java.util.Map<java.lang.String,java.lang.Object> attributes)
public void handleInitialRequest(ServerHttpRequest request, ServerHttpResponse response, SockJsFrameFormat frameFormat) throws SockJsException
AbstractHttpSockJsSession
The "xhr" and "jsonp" (polling-based) transports completes the initial request as soon as the open frame is sent. Following that the client should start a successive polling request within the same SockJS session.
The "xhr_streaming", "eventsource", and "htmlfile" transports are streaming based and will leave the initial request open in order to stream one or more messages. However, even streaming based transports eventually recycle the long running request, after a certain number of bytes have been streamed (128K by default), and allow the client to start a successive request within the same SockJS session.
handleInitialRequest
in class AbstractHttpSockJsSession
request
- the current requestresponse
- the current responseframeFormat
- the transport-specific SocksJS frame format to useSockJsException
AbstractHttpSockJsSession.handleSuccessiveRequest(org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse, org.springframework.web.socket.sockjs.frame.SockJsFrameFormat)
protected void flushCache() throws SockJsTransportFailureException
AbstractHttpSockJsSession
flushCache
in class AbstractHttpSockJsSession
SockJsTransportFailureException
protected void resetRequest()
resetRequest
in class AbstractHttpSockJsSession
protected void writeFrameInternal(SockJsFrame frame) throws java.io.IOException
writeFrameInternal
in class AbstractHttpSockJsSession
java.io.IOException