-
March 26th, 2009, 01:35 PM
#1
Hi DarioCrivelli,
Thanks for your prompt reply. Here is my follow-up question:
I noticed the LightStreamer connection was disconnected and then automatically reconnected in my web app. This happened occasionally but when it happened the disconnect/reconnect cycle was quite often, sometimes once or twice per minute. Any LS server events happened during the disconnect period were lost even after the LS connection was re-connected.
Can you please advise what could cause the frequent LS connection disconnect/reconnect? Also, what should be done when this problem occurs?
Richard
-
March 27th, 2009, 09:07 AM
#2
hi,
if you're talking about a client that degraded to polling due to an overload on the client machine, it could happen that if the machine is still in difficulties the LS client retards so much that its session expires on the server while the client is preparing for the next poll.
You know that you're in this situation if on the server log you see "Synch error" messages.
You can extend the session timeout changing the <session_timeout_millis> element inside the Lightstreamer_conf.xml configuration file.
Another reason for disconnection/reconnection could be a delay in the response from the server (e.g.: problems on the network) but as per your previous post this should not be your problem.
-
March 27th, 2009, 05:36 PM
#3
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
-
March 30th, 2009, 09:12 AM
#4
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
-
March 30th, 2009, 02:34 PM
#5
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
-
March 30th, 2009, 02:51 PM
#6
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.
-
March 30th, 2009, 05:30 PM
#7
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
Similar Threads
-
By chanro4 in forum Client SDKs
Replies: 1
Last Post: January 19th, 2011, 10:23 AM
-
By EWANG in forum Client SDKs
Replies: 12
Last Post: August 19th, 2010, 08:52 AM
-
By GoatHunter in forum Client SDKs
Replies: 3
Last Post: August 31st, 2009, 08:57 AM
-
By rsouissi in forum Client SDKs
Replies: 3
Last Post: February 1st, 2008, 08:49 AM
-
By ddhanis in forum General
Replies: 1
Last Post: December 14th, 2007, 04:39 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 03:59 PM.
Bookmarks