I decided to test how atmosphere framework works with shared websocket connections (shared between browser tabs).
For this I used the sample chat with several little modification in client-side:
I create request as function (so it can be passed to callbacks list inside the atmosphere):
var request = function() {};
for using shared connections I set the appropriate property to true (see link to docs):
request.uuid = $.atmosphere.guid(); request.url = '${url}'; request.contentType = "application/json"; request.transport = 'websocket'; request.fallbackTransport = 'long-polling'; request.shared = true; request.trackMessageLength = true; request.reconnect = true; request.connectTimeout = -1; request.reconnectInterval = 5000; request.timeout = 300000; request.maxRequest = -1;
I pass this request to atmosphere
subsocket = $.atmosphere.subscribe(request, request, request);
And after this everything works perfect (onMessage callback is invoked every time it should be invoked) except one important thing: for other opened tabs which use shared already opened websocket connection the onMessage callback is never invoked at all. So it makes the feature useless, because I couldn't use it.
Could anybody help me with this problem? I believe I do something wrong, but I really need your help.