Results 1 to 8 of 8

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2011
    Location
    Mty
    Posts
    10

    thanks

    Hi Gianluca, thanks for your advises. My name Is Ivanhoe.

    Could I give you more information about this;.

    I have tried with the second option that you gave me, before that you wrote it. But unfortunately it doesn't stop the connection, when i use
    [_my@class unsubscribeItems]; it keeps running. I guess this is my best option for the future, because if i want to show another view i need to stop the connection.

    The first point depends of the second, I guess that I made a terrible mistake when we start to program the app, we use a lot of view controllers in just one class which is not a view controller. I mean in my main class we call all of view and present it. this make hard to solve the problem (stop the connection).

    the last point, could you give an example about how use maxBandwidth, because i seen it, but i couldn't make it works. i just did this;

    [LSConnectionConstraints constraintsWithMaxBandwidth:100.0];


    It is probably that you need more information about my class. I really need help with this.
    I really appreciate if you lend my a hand, you are too kind!!

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

  1. AMF and Consuming Network Bandwidth?
    By ernivan in forum Client SDKs
    Replies: 1
    Last Post: March 11th, 2011, 09:35 AM
  2. Bandwidth and event pushing
    By churrusco in forum General
    Replies: 10
    Last Post: May 8th, 2007, 02:04 PM

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 05:30 AM.