• 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
Async output ready notification for file descriptors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Async output ready notification for file descriptors


  • Subject: Async output ready notification for file descriptors
  • From: Brian Adamson <email@hidden>
  • Date: Wed, 10 Sep 2003 10:16:22 -0400

Does anyone know a non-multithreaded approach in Cocoa for getting asynchronous notification of _output_ readiness for non-blocking file descriptors (associated with pipes, sockets, files, devices, etc)?

Asynchronous notification is readily available for _input_ readiness by using the NSFileHandle object and its "waitForDataInBackgroundAndNotify" method to get "NSFileHandleDataAvailableNotification" ...

But what I'm looking for would be the equivalent of a (fictitious) "waitForOutputReadyInBackgroundAndNotify" method for the NSFileHandle object to get a notification when the associated file descriptor can be _written_ to without blocking ...

The only mention of _writing_ to a NSFileHandle object is the synchronous "writeData" method ...

My reason for this is I have a simple single-threaded, cross platform class which provides asynchronous I/O notification and timers (essentially acts as a custom main loop) ... and I would like to provide a native Cocoa version to go along with my Win32 and Unix versions ... While the Unix version of this works fine on Mac OSX for command-line application purposes, I would like the option of using this class (essentially a custom main loop) for Cocoa GUI applications in the same way it can be used for Win32 and X11 GUI apps ... I would like to avoid multi-threading if possible for various reasons.



--
Brian
__________________________________
Brian Adamson
<http://manimac.itd.nrl.navy.mil>
<mailto:email@hidden>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Async output ready notification for file descriptors
      • From: Cameron Hayne <email@hidden>
    • Re: Async output ready notification for file descriptors
      • From: Glenn Andreas <email@hidden>
  • Prev by Date: Re: Multiple Windows and Cocoa
  • Next by Date: Re: Multiple Windows and Cocoa
  • Previous by thread: Encodigns problem
  • Next by thread: Re: Async output ready notification for file descriptors
  • Index(es):
    • Date
    • Thread