aerogear/aerogear-simplepush-server — pull request #72 by danbev (2014-03-12 09:24:10+00:00)
Title: Fixing SockJS session handling for xhr/jsonp polling.

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:
- SockJS test server can now be started with mvn exec:java
- sockjs-client.html contains examples of specifying transports types

[https://issues.jboss.org/browse/AGSMPLPUSH-42]