-
December 5th, 2013, 03:46 PM
#1
didStartSessionWithPolling: method calling all the time in polling mode
Hi,
In some cases related to a specific network configuration our app switches from streaming to polling.
When the client is in streaming mode didStartSessionWithPolling: delegate method is called only one time when the session is opened (as the <LSConnectionDelegate> protocol reference says) and we use this delegate method to subscribe on tables. But when the client is in polling mode didStartSessionWithPolling: is called almost every second in spite of the fact that in web debugger I see only one call of create_session in the beggining and multiple calls of bind_session.
Is it a normal behavior?
Thanks in advance.
-
December 6th, 2013, 08:53 AM
#2
Hello,
yes, didStartSessionWithPolling: is called even when the session binds again. This means each time a polling connection does its poll cycle, but also when a streaming connection has to rebind since its content length is exhausted.
Best regards,
Gianluca
-
December 6th, 2013, 09:37 AM
#3
Hello again,
consider that the library is able to reconnect and resubscribe automatically. So you should subscribe your table just once, using an internal flag to remember whether the subscription has been done or not. Connection and session events, as long as you accept the automatic reconnection behavior, may happen at any time.
A brief note on the home page of the documentation explains how to avoid the automatic reconnection, that is: by manually closing the connection (better on a separate thread) when a connection failure event occurs. Manually closing the connection also clears the subscription memory, and thus avoids subsequent automatic resubscriptions.
Hope this helps.
Best regards,
Gianluca
Tags for this Thread
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 04:44 AM.
Bookmarks