Results 1 to 10 of 10

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2008
    Location
    Boston
    Posts
    24
    Hi Mone,

    We had a Javascript bug that used to keep the browser frozen for 10 seconds or even longer when it does a long blocking calculation. I guess when the Javascript thread was busy doing this long processing, there is no chance for the LS Javascript client to talk to LS server.

    Could this cause the degradation from STREAMING to POLLING or the disconnect? Can you please explain how the JS client/server decides to disconnect?

    Fortunately I found the bug and fixed it. Now our app won't go into a 10 seconds loop any more.

    Thanks,
    Richard

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    yes, as javascript is mono-thread, blocking the browser in a long execution blocks also the communication with the server and so can cause the coonection to be reinitialized in POLLING.

    The client library passes from STREAMING to POLLING in two cases:
    • the STREAMING connection can't be initialized (ie after opening the connection no data is received before a certain timeout).
      see also setBufferedStreamingHandled
    • there is a heavy load on the machine and the client tries to degradate to POLLING in the hope to diminish such load
      see setSlowingEnabled
    HTH

  3. #3
    Member
    Join Date
    Nov 2008
    Location
    Boston
    Posts
    24
    Hi Mone,

    That explains the degradation from STREAMING to POLLING. Thanks.

    But I'd still like to understand how the connection disconnect/reconnect happens when javascript enters a long running execution block. And how changing <session_timeout-millis> could help mitigate this issue. Can you please advise?

    Thanks,
    Richard

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Hi Richard,

    If the client code cannot consume the heartbeats sent over the stream connections, it will go into STALLED state, and after a while while disconnect and automatically go into CONNECTING state (trying to reconnect).

    You can control these timeouts through the setTimeoutForStalled and setTimeoutForReconnect methods.

  5. #5
    Member
    Join Date
    Nov 2008
    Location
    Boston
    Posts
    24
    Hi Alessandro,

    Thanks for the info. That's very helpful.

    I'm curious how <session_timeout_millis> comes into play with disconnect/reconnect. Does the default value of 5 seconds mean that the connection disconnects after 5 seconds of no heartbeat? Can you please explain?

    Richard

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    The <session_timeout_millis> is unrelated to disconnections and reconnections. It's used when the configured content-length is exhausted, in order to wait for a rebind connection. The only benefit the <session_timeout_millis> provides after a disconnection is to keep the items subscribed toward the Data Adapter for a while, optimizing the next reconnection phase.

 

 

Similar Threads

  1. Replies: 1
    Last Post: January 19th, 2011, 10:23 AM
  2. Client only in polling mode
    By EWANG in forum Client SDKs
    Replies: 12
    Last Post: August 19th, 2010, 08:52 AM
  3. Lightstreamer going into polling mode randomly
    By GoatHunter in forum Client SDKs
    Replies: 3
    Last Post: August 31st, 2009, 08:57 AM
  4. Replies: 3
    Last Post: February 1st, 2008, 08:49 AM
  5. Smart polling mode benefits...
    By ddhanis in forum General
    Replies: 1
    Last Post: December 14th, 2007, 04:39 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 06:17 PM.