-
July 5th, 2012, 09:33 AM
#4
Hello Ivanhoe,
have a look at the StockList Demo for iOS code, which is included in the Lightstreamer distribution. You will notice in the StockListViewController an unsubscribeItems method. This method is called only when the app enters background mode, but if you add a little button somewhere that calls this method you will see it does stop the subscription. Calling the subscribeItems will restart the subscription.
My suggestion for you is to refactor your code so that you can selectively subscribe and unsubscribe your items entering and exiting specific view controllers, similarly to what the StockList Demo does. Besides this, the Lightstreamer library has no way to guess what you are putting on the screen, if it's not you that stop the subscriptions the library surely can't.
About connection constraints, the right way to use them is to create an LSConnectionConstraints, set the maxBandwidth in kbit/sec and then either: add it to a LSConnectionInfo (method setConstraints) during the initial setup of the Lightstreamer connection, or use it to change an open connection (method changeConnectionWithConstraints of LSClient). For example:
LSConnectionConstraints *constraints= [[LSConnectionConstraints alloc] init];
constraints.maxBandwidth= 10.0;
[myClient changeConnectionWithConstraints:constraints];
Hope this helps.
Best regards,
Gianluca
Similar Threads
-
By ernivan in forum Client SDKs
Replies: 1
Last Post: March 11th, 2011, 09:35 AM
-
By churrusco in forum General
Replies: 10
Last Post: May 8th, 2007, 02:04 PM
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 01:22 PM.
Bookmarks