• 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: NSFileHandle weirdness on 10.5 ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileHandle weirdness on 10.5 ...


  • Subject: Re: NSFileHandle weirdness on 10.5 ...
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 16 Jan 2010 06:12:51 -0600

On Jan 12, 2010, at 12:46 PM, Heizer, Charles wrote:

> I'm hoping someone can help me out here. I'm trying to use IPC (Unix domain socket AF_UNIX) to pass data between two applications.
>
> I have a console application which is sending data to the socket path and a Cocoa GUI app which is reading it using NSFileHandle. The problem I'm seeing is on 10.5 systems I'm not getting all of the data. I'm only getting 502 characters, but on 10.6 i'm getting the whole thing.
>
> Is there some kind of buffer size I can adjust, I'm not really sure what to do?

You don't say what methods of NSFileHandle you're using to read the data.  In particular, some of the asynchronous methods require that you re-issue the request to keep reading.  For example, -readInBackgroundAndNotify will post an NSFileHandleReadCompletionNotification notification when it reads _some_ data.  In your handler for that notification, you must repeat the -readInBackgroundAndNotify invocation to read more data.  You will know you've read to end-of-file (or closing of a communications channel) when you receive an empty data object in that notification.

Regards,
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

References: 
 >NSFileHandle weirdness on 10.5 ... (From: "Heizer, Charles" <email@hidden>)

  • Prev by Date: Re: Adding to-many objects programmatically
  • Next by Date: Re: Confused about setting selection in NSBrowser
  • Previous by thread: NSFileHandle weirdness on 10.5 ...
  • Next by thread: (void *)contextInfo
  • Index(es):
    • Date
    • Thread