-
August 26th, 2011, 12:03 AM
#1
Don't send message when refresh the browser
Hi all,
I have a little problem, I hope you can help me.
My LS server send a message to the subscriptor
the browser catch the message and reload the browser
when the browser finished loading, establishes the connection with the LS server
the LS server send (again) the same message to the subscriptor and the browser catch (again) the message and relado the browser
this is repeated indefinitely
How I can tell to the LS server that sends the message only once to all browsers subscribers?
I hope you have understood my question
thanks in advance.
Naitsir
-
August 26th, 2011, 01:26 PM
#2
May you please provide more details?
If the message is an error notification, you cannot prevent the Server from sending it and the client should be responsible for deciding whether or not to retry. Reloading the page is not an action performed by LS html client library, so I suppose that you are referring to application code.
If the message is a value update, note that the Server resends old updates only if the snapshot has been requested. The client can avoid requesting the snapshot for the involved items.
-
August 26th, 2011, 02:31 PM
#3
Hi Dario, thanks for you reply,
the message is a simple string, at any time (that is not relevant) my LS server send a string to the subscriptor.
on the browser, my app (javascript code) catch the message (the string) and compares it with another string, if the comparison is true my app tells the browser to reload ( window.location.reload(true); )
heretofore work as want to work
the problem is that when the browser reconnects to my LS server (after reload), the LS server send the message again, and my app compares the string again and tells the browser to reload.
this is done indefinitely :S
why the LS server again sent the last message to the subscriptor, when the subscriptor reload the browser??
is this a normal behavior?
how can i fix this problem??
thanks for your help
naitsir
-
August 29th, 2011, 09:29 AM
#4
It seems to me that the second one of my previous hypothesis holds: you refer to an update for some item.
I confirm that the only reason why Lightstreamer Server should send the same update multiple times is that the item has been subscribed to by requesting the snapshot.
When the browser reloads the page, the page probably issues some subscriptions immediately, so it immediately receives the snapshots related with the subscribed items, that may consist in the latest update received.
So, please check the way your application performs its subscriptions; if any snapshots are requested, you should consider removing the request, depending on the meaning of your items.
-
August 29th, 2011, 02:46 PM
#5
Thanks Dario,
I will check how to set to the settings that the browser not request a snapshot. but if you could tell me where I do this, you save me time.
Regards,
Naitsir
-
August 30th, 2011, 10:25 AM
#6
The snapshot is requested through a call to setSnapshotRequired, so you should find it easily in your Push-Page.
The call operates at Table level, hence it applies to all items in the Table.
-
October 2nd, 2012, 04:19 AM
#7
My case is in the other way round.
After my client refresh the page (manually by clicking the refresh button on the browser), LS server only send me the last action for each key value only. For example, the flow of the data should start from
1) send the add string to the browser (Command = add)
2) update the data value multiple time (Command = update)
After refresh, the LS server only send me the last update data value (Command=add).
My javascript will check if the add string is provided, than only will add the data to the page, else will get the value and update, in this case, no data being add to display and the value update is not successfully done.
Can please help to advice how and why this happen.
-
October 2nd, 2012, 10:36 AM
#8
Hi David,
In COMMAND mode for “Snapshot” it is intended the current state of the entire list, consisting of a set of itemEvents, one for each “key”.
Note that the snapshot is not a playback of the commands received so far.
So, it is the normal behaviour that you receive a "ADD" command with the last data values for each keys present in the Item at the moment of the snapshot request.
Anyway in COMMAND mode you must always consider that data values are sent with the "ADD" commands. Whatever the implementation of your adapter
this can happen both in phase of snapshot request and in cases where the servrer must match multiple updates (an ADD with a subsequent UPDATE merged due to frequency or bandwidth limits for example).
Hope that help.
Similar Threads
-
By finodex in forum Client SDKs
Replies: 1
Last Post: June 6th, 2012, 10:32 AM
-
By hungtt in forum Adapter SDKs
Replies: 7
Last Post: December 30th, 2010, 03:42 AM
-
By latha in forum Client SDKs
Replies: 1
Last Post: January 18th, 2010, 03:27 PM
-
By naitsir in forum Client SDKs
Replies: 5
Last Post: October 23rd, 2009, 01:49 PM
-
By naitsir in forum Client SDKs
Replies: 9
Last Post: October 19th, 2009, 04:02 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:48 PM.
Bookmarks