Results 1 to 7 of 7
  1. #1

    Question When disconnected, the client tries to reconnect only 2 times

    Hi,

    I'm currently testing the Lightstreamer Javascript Client and it appears that when the connection is lost, the client will only try to reconnect twice, after that it is stuck at the DISCONNECTED:WILL-RETRY status.

    I didnt find anything on the doc about some max-retry attempts options.
    See below :
    CONNECTING
    CONNECTED:STREAM-SENSING
    CONNECTED:WS-STREAMING
    SUBSCRIBED
    STALLED
    UNSUBSCRIBED
    DISCONNECTED:WILL-RETRY
    CONNECTING
    DISCONNECTED:WILL-RETRY

    I manually disabled my ethernet connection to see how it respond, and after enabling my ethernet again I'm stuck with this status. How can I ensure that my application reconnects if my Internet connection fails for some times ?

    PS: Is it possible that the targeted server deletes my security token and so any new connection with the old token will fail ?
    Last edited by Yves; March 7th, 2016 at 11:40 AM.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    541
    Hi Yves,

    Please, could you specify the exact version of the library in use?
    I can confirm that the behavior that you experienced is not the one expected.

    Could you repeat the same test with one of our demo, such as this "StockListDemo_Basic".
    In addition, if you are able to capture the console output of your client application, please add the following to the page (might obviously need changes depending on the kind of library you're using):


    the log will appear in the browser console.

    Regards,
    Giuseppe

  3. #3
    Hi Giuseppe,

    Thank you for the reply.

    I'm using the client version 6.1.4 in Node.js along with the IG Bank servers.
    (npm install lightstreamer-client@6.1.4 as seen in this post http://forums.lightstreamer.com/show...tication/page2)

    I used the the following url as requested.

    Code:
    var lsClient = new ls.LightstreamerClient("http://push.lightstreamer.com","DEMO");
    CONNECTING
    CONNECTED:STREAM-SENSING
    CONNECTED:WS-STREAMING
    SUBSCRIBED
    Ations Europe: 18.0
    Bagies Consulting: 7.23
    Anduct: 2.99
    Ations Europe: 17.99
    Ations Europe: 17.91
    Ations Europe: 18.0
    Ations Europe: 17.96
    Bagies Consulting: 7.26
    Ations Europe: 18.1
    Ations Europe: 18.09
    Bagies Consulting: 7.31
    Ations Europe: 17.93
    Ations Europe: 18.08
    STALLED
    UNSUBSCRIBED
    DISCONNECTED:WILL-RETRY
    CONNECTING
    DISCONNECTED:WILL-RETRY

    As you can see I still have the same issue.

    For the logging, I wasn't able to use your code in my Node app, sorry..

    Used the sample code provided in your docs

    Code:
    var ls = require("lightstreamer-client");
    var lsClient = new ls.LightstreamerClient("http://push.lightstreamer.com","DEMO");  
    lsClient.connect();
    
    var testSubscription = new ls.Subscription("MERGE",["item1","item2","item3"],["stock_name","last_price"]);
    testSubscription.setDataAdapter("QUOTE_ADAPTER");
    testSubscription.setRequestedSnapshot("yes");
    lsClient.subscribe(testSubscription);
    
    lsClient.addListener({
        onStatusChange: function(newStatus) {         
          console.log(newStatus);
        }
    });
     
    testSubscription.addListener({
        onSubscription: function() {
          console.log("SUBSCRIBED");
        },
        onUnsubscription: function() {
          console.log("UNSUBSCRIBED");
        },
        onItemUpdate: function(obj) {
          console.log(obj.getValue("stock_name") + ": " + obj.getValue("last_price"));
        }
    });

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    541
    Hi Yves,

    Sorry, I assumed that it was a browser application.
    Indeed, in case of Node.js, it may be that you stumbled over a bug introduced right from the 6.1.4 version and fixed in version 6.2.7, available in npm.

    Have you the possibility to try this latest version?

    Regards,
    Giuseppe

  5. #5
    Hi Giuseppe,

    Good news! I installed the 6.2.7 client and it fixed the issue both on IG and your Demo env. It tries to reconnect indefinitely and reconnect when connection is available.

    Btw, I thought I needed the version 6.1.4 to use the streaming API of IG. Could you confirm that the 6.2.7 is ok though?

    Thanks.

    Yves

  6. #6
    Also a quick question. Does the Lightstreamer server sends back the datas that couldn't been send during the connection lost or are those data completly lost ?

  7. #7
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    541
    Hi Yves,

    I confirm that you can safely use the 6.2.7 version of the JavaScript library.

    About the connection lost, theoretically, Lightstreamer allows you to leverage the snapshot request to realigning all client data as soon as the connection is re-established.
    You can find further details in the section "3.4.1 Snapshot" of the "General Concepts.pdf" documentation.

    But please consider that the Snapshot could be enabled or disabled and the behavior customized in the Adapters implementaion. So you should refer to IG, for all implementation details.

    Regards,
    Giuseppe

 

 

Similar Threads

  1. Network disconnected at client side
    By mhasan in forum Client APIs
    Replies: 1
    Last Post: June 25th, 2015, 10:40 AM
  2. Replies: 1
    Last Post: December 16th, 2010, 10:41 AM
  3. Streaming system is disconnected
    By ivailo in forum Client APIs
    Replies: 2
    Last Post: December 1st, 2009, 01:07 PM
  4. config auto-reconnect interval
    By EWANG in forum Client APIs
    Replies: 1
    Last Post: June 30th, 2009, 09:54 AM
  5. Replies: 1
    Last Post: November 6th, 2008, 09:44 AM

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 10:59 AM.