-
November 25th, 2008, 12:34 PM
#1
stopping, restarting connection
In my case, user need not to get updates all the time; when ever he stops receiving real time data, i wanna stop the connection and should restart it whenever he wants.
i use following to remove a table, when he presses the stop button.
if (lsPage.getTable(tableId)) lsPage.removeTable(tableId);
lsPage = null;
when he press restart i call following,
lsPage = new PushPage();
lsPage.onEngineCreation = function(engine) {
engine.connection.setLSHost("mydomain/push");
engine.connection.setLSPort(null);
engine.connection.setAdapterName("MyAdapter");
engine.changeStatus("STREAMING");
};
lsPage.bind();
lsPage.createEngine("MyEngine", "../ls");
//lsPage.addTable(////);
when i do it, it throws an exception(client side) stating that
"createEngine() has already been called";
If i dont recreate the engine this doesnt happen obviously.
my original requirement is to keep the connection only when he requires it.
is there any way to totally disconnect from the server when he doesnt need it. ( even i set lsPage as null, it tries to keep the connection. [for example it shows in firebug "GET STREAMING IN PROGRESS" when i stop the lightstreamer server]) Could you please assist me in this, so that i can stop/start connection when it is required?
will it be able to do it by changing the status to disconnected, when he stops? if so, could you please give me some code snippet to stop the server, coz i'm struggling to do it for a long time?
Similar Threads
-
By finodex in forum Adapter SDKs
Replies: 5
Last Post: May 14th, 2012, 02:47 PM
-
By igindex in forum Client SDKs
Replies: 1
Last Post: October 27th, 2009, 05:50 PM
-
By quanhm in forum General
Replies: 1
Last Post: November 16th, 2007, 12:32 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 10:10 PM.
Bookmarks