Re: UNIX signals
Re: UNIX signals
On 17 Dec 2008, at 03:22, Michael Ash wrote:
On Tue, Dec 16, 2008 at 8:02 PM, Chris Idou <email@hidden> wrote:
Is there any Cocoa and/or Carbon interface to UNIX signals?
Nope.
Yes.
For a Cocoa solution see MessagingSignalHandler available at http://www.fivesquaresoftware.com/source/
This schedules an NSMachPort in the runloop.
Seems to work well.
Nope. It's pretty easy to set up a signal handler that can call back
to a Cocoa/CoreFoundation runloop though, by having it write to a pipe
or mach port which the runloop monitors.
However it's rarely useful to monitor signals in GUI apps, so you may
not want to actually do this.
In my case I use it with a Foundation server that opens ports on the
network router.
If the server is killed, the signal is caught and we can close our
router ports before we breathe our last.
Jonathan Mitchell
Central Conscious Unit
http://www.mugginsoft.com
_______________________________________________
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