-
February 20th, 2009, 11:11 AM
#1
Warning when making multiple connections from the same browser session
Hi guys,
We have a web app that uses multiple Lightstreamer data adapters. The application also allows you to open multiple browser windows. When opening a new window you get taken to a page that connects to Lightstreamer.
When you open one of these windows from a page already connected to Lightstreamer (but to a different data adapter) the following warning appears:
ER changeStatus Warning: there is probably another web application connected to the same Lightstreamer Server within this browser instance. That could prevent the current application from connecting to the server. Please close the other application to unblock the current one.
When closing the alert, the page connects to Lightstreamer as expected. This happens in both Firefox and Internet Explorer. My questions are:
1) Are there any settings we can use at the client (or server) to prevent the warning message from being displayed?
2) Are there any risks in connecting to different data adapters with the same session? Do we need to configure the server to cope with this?
Thanks,
Richard
-
February 23rd, 2009, 11:21 AM
#2
Hi Richard,
To prevent this issue, make sure you use "SHARE_SESSION" as the onSimilarEngineFound parameter of the createEngine function.
All your Data Adapters must be part of the same Adapter Set. With this kind of configuration, there is no risk in having the same session access any number of different Data Adapters. As a reference example of multiple Adapter configuration, take a look at the pre-installed demos available in the Lightstreamer distribution.
-
February 23rd, 2009, 11:40 AM
#3
Hi Alessandro, thanks for your response.
The problem we have is that our application contains some complex logic in the metadata adapters, which is adapter specific. So Adapter A can't be bundled with Adapter B as it requires a completely different metadata adapter.
As I understand it, the multiple adapter configuration groups adapters with a single metadata adapter. Is this the case and, if so, can you think of any other workarounds for our problem?
Thanks,
Richard
-
February 23rd, 2009, 12:31 PM
#4
Richard,
The solution is to implement some simple switch logic in your Metadata Adapter. In other words, the Metadata Adapter is physically one, but based on the item names (thus, on the Data Adapter), it can delegate the actual logic to different classes.
Of course, the authentication logic should be independent of the Data Adapter. It's only the authorization logic that can be switched based in the Data Adapter.
Does this meet your needs?
Cheers
Alessandro
-
February 23rd, 2009, 05:57 PM
#5
We were hoping to avoid implementing a delegating Metadata adapter as it adds complexity, although it seems that might be the only way forward.
As a general question, why is it a problem to have multiple browser instances connecting to different data adapters as in our application? We notice that, when the user clicks 'Ok' on the alert box, the data streams correctly, so we're not entirely sure why the warning is shown.
Thanks,
Richard
-
February 24th, 2009, 11:42 AM
#6
Richard,
It all depends on the connection pool of the browser. Each browser process instance allows a maximum number of concurrent connections to the same host. In some cases this number is 2, in other cases it's larger.
If you launch independent browser instancesm the connection pool is not shared. But this applies to IE and not to Firefox (which creates one process instance only).
If you don't want to share your Lightstreamer connection (and Metadata Adapter) among multiple Data Adapters, a trick could be to use alias hostnames. In some cases, the browser just looks at the hostname and not at the IP address to allocate a connection pool.
Similar Threads
-
By Adrian Parker in forum Client SDKs
Replies: 1
Last Post: September 26th, 2011, 10:01 AM
-
By sachinpatel2 in forum Client SDKs
Replies: 1
Last Post: March 25th, 2010, 10:04 AM
-
By mnfjorge in forum Client SDKs
Replies: 1
Last Post: March 24th, 2010, 09:52 AM
-
By EWANG in forum Adapter SDKs
Replies: 1
Last Post: April 29th, 2009, 09:38 AM
-
By Waddy in forum Client SDKs
Replies: 4
Last Post: May 14th, 2007, 03:38 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 06:30 PM.
Bookmarks