Yury.Ku
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.
gianluca.bertani
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
gianluca.bertani
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