Re: How to throttle rate of NSInputStream?
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