• 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: Ken Thomases <email@hidden>
  • Date: Tue, 27 Mar 2012 03:20:17 -0500

On Mar 26, 2012, at 6:13 PM, 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.

You can try simply unscheduling the stream from the run loop until you're ready for more.  I'm not 100% certain that that's safe, in the sense that no events will be lost.  It should be safe.  I would consider it a bug if it weren't, but you never know.  You can probably ameliorate that by attempting to read immediately after re-scheduling it on the run loop.

Cheers,
Ken


_______________________________________________

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>)

  • Prev by Date: Question about UIImage, scaling, and UIGraphicsBeginImageContextWithOptions
  • Next by Date: Re: Question about UIImage, scaling, and UIGraphicsBeginImageContextWithOptions
  • Previous by thread: Re: How to throttle rate of NSInputStream?
  • Next by thread: Re: How to throttle rate of NSInputStream?
  • Index(es):
    • Date
    • Thread