Results 1 to 3 of 3
  1. #1
    Power Member
    Join Date
    Nov 2012
    Posts
    182

    Event that traps an unexpected disconnect

    In the case where the Lightstreamer server becomes unavailable to the client for any reason (maybe it has just been shut down deliberately), the client will go into a loop trying to reconnect - that is to say you see calls to create_session.js appearing in the console.

    We have a situation where if this happens overnight - i.e. the server is down for backups etc, the console will literally be full of thousands of the retry calls. In the case of the Chrome developer tools, it seems that the PC becomes almost unresponsive until you manage to clear the console with a refresh.

    It may not be a problem for the average user since they are unlikely to have the developer tools open, but I would like to know if there is an event that fires that I can tap into every time the LS client retries the connection and fails? I would like to terminate the automatic retry after a certain period of time and until there has been some interaction with the user to indicate that they wish to restart the connection.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi Kpturner,

    Assuming you're using a >=6 client version you can detect such cycles by listening to the onStatusChange event of the client listener: http://www.lightstreamer.com/docs/cl...tListener.html
    In your case you'll see the client switching from DISCONNECTED:WILL-RETRY to CONNECTING then back to DISCONNECTED:WILL-RETRY (for retryTimeout millis) and so on

    HTH

  3. #3
    Power Member
    Join Date
    Nov 2012
    Posts
    182
    Yes I am - and that will do just perfectly thanks

 

 

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 05:28 PM.