Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Nov 2007
    Location
    London
    Posts
    18

    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

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    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.

  3. #3
    Member
    Join Date
    Nov 2007
    Location
    London
    Posts
    18
    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

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    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

  5. #5
    Member
    Join Date
    Nov 2007
    Location
    London
    Posts
    18
    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

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    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

  1. Multiple browser tabs
    By Adrian Parker in forum Client APIs
    Replies: 1
    Last Post: September 26th, 2011, 09:01 AM
  2. Replies: 1
    Last Post: March 25th, 2010, 09:04 AM
  3. Multiple Connections
    By mnfjorge in forum Client APIs
    Replies: 1
    Last Post: March 24th, 2010, 08:52 AM
  4. Multiple Adaptors for one stream session
    By EWANG in forum Adapter APIs
    Replies: 1
    Last Post: April 29th, 2009, 08:38 AM
  5. Multiple connection warning alerts from Firefox
    By Waddy in forum Client APIs
    Replies: 4
    Last Post: May 14th, 2007, 02:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:41 PM.