-
May 12th, 2010, 07:33 AM
#1
Track the Server disconnection
I am working on Java Web application using Light Streamer.
I am trying to track the LS disconnection on My Web Page with the following code.
engine.onStatusChange = function(chngStatus)
if (chngStatus == "DISCONNECTED") {
alert("Status : " + chngStatus);
window.location.reload();
}
if (chngStatus == "STALLED") {
alert("Status : " + chngStatus);
window.location.reload();
}
}
But this event is fired while closing LS as well as browser (Page). But I want to track LS disconnection on the above.
What i missed there? Or is there any other way to track the same.
Thanks in advance.
-
May 12th, 2010, 10:26 AM
#2
hi,
when you close the browser or the server the client actually disconnects, that's why the onStatusChange is called.
also STALLED is not the same as DISCONNECTED as the former can just be caused by a delay in the network
you may want to also listen to the onEngineLost event as a lost engine also means "no connection available"
finally I see that you want to reload the page when your client disconnects. May I ask you why? Are you experiencing any problem that lead you to take this approach?
Similar Threads
-
By Sathyaayyanar in forum Adapter SDKs
Replies: 5
Last Post: June 26th, 2015, 09:49 AM
-
By magnum_rg in forum Client SDKs
Replies: 5
Last Post: August 12th, 2011, 10:43 AM
-
By vaduganathan in forum Adapter SDKs
Replies: 1
Last Post: May 28th, 2010, 10:34 AM
-
By churrusco in forum General
Replies: 15
Last Post: April 20th, 2010, 09:46 AM
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 01:22 AM.
Bookmarks