Re: Not getting an NSStreamEventHasBytesAvailable message
Re: Not getting an NSStreamEventHasBytesAvailable message
- Subject: Re: Not getting an NSStreamEventHasBytesAvailable message
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Mon, 13 Feb 2017 23:02:23 +0000
On 10 Feb 2017, at 04:34, Jens Alfke <email@hidden> wrote:
> Also, the examples in Apple’s “Stream Programming Guide” only issue a single read call in response to a bytes-available event.
That’s the correct approach. Repeatedly calling `-read:maxLength:` inside your `.hasBytesAvailable` handler can cause various odd problems, not least of which is the starvation of other streams scheduled on the same run loop.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden