This repository has been archived by the owner on Nov 18, 2018. It is now read-only.
Fixing SockJS session handling for xhr/jsonp polling. #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The is a re-opening of AGSMPLPUSH-42 which intended to fix this issue
but the fix was just plain wrong.
The original issue was that the polling transports did to reply with any
data when messages had been sent to them. The fix then was to add an
explicit empty reply to trigger SockJS to repoll and it was then able
to retrieve data.
But the polling transports are "long polling" in that they will remain
until either data is made available by the server side or the session
times out.
This commit fixes the session handling by introducing a field in the
SockJSSession class which is the ChannelHandlerContext used for an
open connection. This 'openContext' is then available to be used
by SessionState implementations, for example the PollingSessionState.
PollingSessionState sometimes needs to use the ChannelHandlerContext
used to connect which is needed to send the SockJS OpenFrame, but
successive calls needs to use the ChannelHandlerContext for the
open session.
Additional changes:
[https://issues.jboss.org/browse/AGSMPLPUSH-42]