Results 1 to 3 of 3
  1. #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.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    102
    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

  3. #3
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    102
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 10:07 AM.