Results 1 to 10 of 26

Threaded View

  1. #1
    Senior Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    74

    I have issue on connecting LS server in multiple page

    (App developed my using Ionic Cordova platform.)
    I have an application like trading platform. In my first page, I need to display all of the live rates(List of stocks and their rates). If they click on trade button I need to display only what every tradable stock. And If click on the stock from this I need to display responding stock details and Bid and Ask price and from this screen, users will submit their required quantity and submit the page. For every page currently, i'm opening the new connection.

    var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
    var portToUse = document.location.protocol == "https:" ? "443" : "8080";
    var lsClient = new Lightstreamer.LightstreamerClient(protocolToUse+"//domain.com:"+portToUse,"STOCKLIST_REMOTE");
    lsClient.connect();

    As like that connecting in all of my three pages. But If I navigate the pages means connection getting close automatically. Showing the error like session terminated. Could you please help me anyone to fix this issue. Or else id there any other way to share the connection(connectionSharing) from one page to another page. I have tried like below code but issue happens. It says have to add connection sharing library.
    lsClient.connectionSharing.enableSharing("CommonCo nnection", "ATTACH", "CREATE");
    And also I need if we use connectionsharring means how to use that shared connection in another page.
    I have below code in all of my three page controller(I'm using ionic framework for my android application )
    var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
    var portToUse = document.location.protocol == "https:" ? "443" : "8080";
    var lsClient = new Lightstreamer.LightstreamerClient(protocolToUse+"//domain.com:"+portToUse,"STOCKLIST_REMOTE");
    lsClient.connectionOptions.setHttpExtraHeaders({"u sername" : "bullion"});
    lsClient.addListener({
    onStatusChange: function(newStatus) {
    console.log(newStatus);
    }
    });
    lsClient.connect();
    Last edited by rvkvino; November 27th, 2017 at 07:52 AM.

 

 

Similar Threads

  1. How to create 2 engines in one page?
    By dimitarn in forum Client APIs
    Replies: 5
    Last Post: December 10th, 2009, 10:52 AM
  2. More tables in one page scenario
    By cbrogliato in forum Client APIs
    Replies: 1
    Last Post: October 2nd, 2009, 02:13 PM
  3. Replies: 5
    Last Post: July 17th, 2008, 10:01 AM
  4. Problem connecting GI to LS server
    By camerone in forum Client APIs
    Replies: 1
    Last Post: August 20th, 2007, 02:37 PM
  5. Replies: 1
    Last Post: March 15th, 2007, 02:44 PM

Tags for this Thread

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 02:44 AM.