Results 1 to 10 of 26

Hybrid View

  1. #1
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Could you please give me the code sample that creating an instance from lsClient. I have tried but showing lsClinet not having constructor method.
    Last edited by rvkvino; November 28th, 2017 at 10:51 AM.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi rvkvino,

    Basically, in every page you should have something like this

    var lsClientPageX = new LightstreamerClient(protocolToUse+"//mydomain.com:"+portToUse,"SLNSTOCKLISTDEMO_REMOTE" );

    lsClientPageX.enableSharing(new Lightstreamer.ConnectionSharing("CommonConnection" , "ATTACH", "CREATE"));


    Regards,
    Giuseppe

  3. #3
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hi,
    I have tried this already, But what happens means if I give this connection to open all the page means It terminating the session and continuously trying to reconnect the session. While I navigate the tabs more than 3 times means it disconnect the session.

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi rvkvino,

    Any chance to collect the client log of one of the page?
    You should add to your code something like this:



    the log will appear in the browser console.

    Regards,
    Giuseppe

  5. #5
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hi,
    I have tried this like below, It is working on my browser but not working on the device.
    This file written in lsconnection.js and globally included in my 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+"//mydomain.com:"+portToUse,"STOCKLIST_REMOTE");
    lsClient.connectionOptions.setHttpExtraHeaders({"u sername" : "bullion"});
    lsClient.enableSharing(new Lightstreamer.ConnectionSharing("CommonConnection" , "ATTACH", "CREATE"));
    lsClient.connect();

    And all of my three controllers written the code like bellow and subscribed in this controller only.
    var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
    var portToUse = document.location.protocol == "https:" ? "443" : "8080";
    var lsClient = new Lightstreamer.LightstreamerClient(protocolToUse+"//mydomain.com:"+portToUse,"STOCKLIST_REMOTE");
    lsClient.connectionOptions.setHttpExtraHeaders({"u sername" : "bullion"});
    lsClient.enableSharing(new Lightstreamer.ConnectionSharing("CommonConnection" , "ATTACH", "CREATE"));
    var liverateSubscription = new Lightstreamer.Subscription("COMMAND", liverateId, fieldList);

    This working well without terminate the session on browser (ionic serve --lab). But not working after build the app and check in real device.

  6. #6
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi rvkvino,

    Please let me suggest some tests to be run:

    1. Have you tried a very simple application with only one page and one subscription just to chek if is ok on a real device?
    2. Could yuo tried your code without the lsClient.enableSharing(...) statement?

    Regards,
    Giuseppe

  7. #7
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    I have many application with one subscription on one page. I didn't get any issue on that application on real device.
    And also I have tried in this application without using lsClient.enableSharing in this case losing the session after navigate 3 times between connected LS Server page.

    We are on fire, Client making urgent to fix this issue soon. could you please help me to fix this issue soon.

    lightstreamer.subscriptions | INFO | 13:23:07,330 | 10] Subscribing subscription {[|Subscription|1|0||0|||] }
    lightstreamer.js:556 lightstreamer.subscriptions | INFO | 13:23:07,332 | 352] Subscription entered the active state {[|Subscription|5|0|1|1||2|] }
    lightstreamer.js:556 lightstreamer.subscriptions | INFO | 13:23:07,335 | 10] Subscribing subscription {[|Subscription|1|0||0|||] }
    lightstreamer.js:556 lightstreamer.subscriptions | INFO | 13:23:07,336 | 352] Subscription entered the active state {[|Subscription|5|0|2|1||3|] }
    lightstreamer.js:556 lightstreamer.sharing | INFO | 13:23:07,342 | 341] A sharing will now be searched {}
    lightstreamer.js:556 lightstreamer.sharing | INFO | 13:23:07,343 | 312] Start search for an engine {}
    lightstreamer.js:556 lightstreamer.sharing | INFO | 13:23:07,353 | 319] valid engine values found, will try to connect to it {}
    lightstreamer.js:556 lightstreamer.sharing | INFO | 13:23:07,355 | 317] A sharing was found, this will attach to it {}
    lightstreamer.js:556 lightstreamer.sharing | INFO | 13:23:07,357 | 311] Stop search for an engine {}
    controllers.js:773 CONNECTED:HTTP-STREAMING
    lightstreamer.js:556 lightstreamer.subscriptions | INFO | 13:23:08,106 | 353] Subscription is now subscribed to {[|Subscription|4|0|1|2|1|2|] }
    lightstreamer.js:556 lightstreamer.grids | INFO | 13:23:08,108 | 411] Cleaning the model {[|liverates|0|0|] }
    lightstreamer.js:556 lightstreamer.subscriptions | INFO | 13:23:08,447 | 353] Subscription is now subscribed to {[|Subscription|4|0|2|2|2|3|] }
    Last edited by rvkvino; November 30th, 2017 at 07:53 AM.

 

 

Similar Threads

  1. How to create 2 engines in one page?
    By dimitarn in forum Client SDKs
    Replies: 5
    Last Post: December 10th, 2009, 10:52 AM
  2. More tables in one page scenario
    By cbrogliato in forum Client SDKs
    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 SDKs
    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 01:39 AM.