• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to throttle rate of NSInputStream?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to throttle rate of NSInputStream?


  • Subject: Re: How to throttle rate of NSInputStream?
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 28 Mar 2012 17:16:34 -0700

At 8:52 AM +0100 3/27/12, Quinn \"The Eskimo!\" wrote:
> On 26 Mar 2012, at 21:28, Jens Alfke wrote:
>
>> What can I do about this? Ideally I'd like the stream to hold off on reading more from the socket until my code finishes processing the buffer..
>
> If you don't call -read:maxLength:, the stream won't send you another NSStreamEventHasBytesAvailable event.

BTW, that observation allowed me to fix my code. As Quinn suggested, if I’m busy chewing on the data I already read, I just set a flag reminding myself that there’s data available instead of reading it right away. That seems to make all the flow control/buffering work correctly.

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >How to throttle rate of NSInputStream? (From: Jens Alfke <email@hidden>)
 >Re: How to throttle rate of NSInputStream? (From: "email@hidden" <email@hidden>)
 >Re: How to throttle rate of NSInputStream? (From: Steve Sisak <email@hidden>)

  • Prev by Date: Re: Getting the best frame rate for NSView drawing
  • Next by Date: Re: Can't delete file on device
  • Previous by thread: Re: How to throttle rate of NSInputStream?
  • Next by thread: File types...
  • Index(es):
    • Date
    • Thread