On 26/7/11 1:14 AM, "Scott Ribe" <[email protected]> wrote:

> On Jul 25, 2011, at 3:40 AM, Shane Stanley wrote:
> 
>>> I wonder if they've changed how the readInBackgroundAndNotify works.
>> 
>> Yes, they have. I logged a bug on it, and was told that the way it worked in
>> 10.6 was wrong -- whereas it used not to send a notification until there was
>> something to read, it now returns one immediately regardless. Whether that's
>> the problem here, I don't know.
> 
> That's absolutely demented. If it sends a notification immediately, with or
> without data, then you're never really using it to read in the background,
> you're almost just spinning in a busy loop, getting a probably empty NSData,
> and calling readInBackgroundAndNotify again, as fast as the runloop can
> deliver the notifications.

Exactly. I built a sample app that did exactly that, and logged radar
#9120065. I was told that was correct behavior, and that "Snow Leopard's
NSFileHandle never correctly notified with a zero length data at EOF". The
suggested fix was "do a blocking -readDataOfLength: call on a background
thread".

-- 
Shane Stanley <[email protected]>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to