Re: NSPipe (NSFileHandle) writedata limit?
Re: NSPipe (NSFileHandle) writedata limit?
- Subject: Re: NSPipe (NSFileHandle) writedata limit?
- From: Dave Keck <email@hidden>
- Date: Fri, 9 Apr 2010 08:25:02 -1000
> I am not getting an error; it just hangs.
This is the classic sign that the pipe's buffer is full and that your
consuming process isn't reading the available data from the pipe. If
you attach to the producing process, I would expect its stack trace to
look like:
#0 0x95030c7e in write$UNIX2003
#1 0x93ea84a9 in -[NSConcreteFileHandle writeData:]
...
Is this the case? Assuming it is, perhaps:
1. The value of 'sz' is incorrect at the call to -sendData:?
2. Your consumer is treating 'sz' as the wrong type (likely a short)?
I'd put my money on #2. Treating an NSUInteger with a value of >=
65536 as a short will result in the most significant two bytes being
lost, thus your consumer will be reading very little amounts of data
relative to the available data, and your producer will hang waiting
for the buffer to be cleared.
_______________________________________________
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