• 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: NSPipe (NSFileHandle) writedata limit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSPipe (NSFileHandle) writedata limit?
      • From: "McLaughlin, Michael P." <email@hidden>
References: 
 >Re: NSPipe (NSFileHandle) writedata limit? (From: Dave Keck <email@hidden>)
 >Re: NSPipe (NSFileHandle) writedata limit? (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: Re: How do I compare two NSDates using NSPredicate & Core Data
  • Next by Date: Re: NSPipe (NSFileHandle) writedata limit?
  • Previous by thread: Re: NSPipe (NSFileHandle) writedata limit?
  • Next by thread: Re: NSPipe (NSFileHandle) writedata limit?
  • Index(es):
    • Date
    • Thread