Re: Gui-less daemon based on NSFileHandle
Re: Gui-less daemon based on NSFileHandle
- Subject: Re: Gui-less daemon based on NSFileHandle
- From: Jerry Krinock <email@hidden>
- Date: Sat, 17 Dec 2005 08:33:53 -0800
- Thread-topic: Gui-less daemon based on NSFileHandle
on 05/12/17 08:02, John Axel Eriksson at email@hidden wrote:
>
It's really a very simple app for debugging Flash applications.
>
>
Now I would like to make it gui-less, i.e a daemon run from the
>
terminal.
Terminology: I may be wrong, but I believe what you would like to make is a
"command-line tool" or "tool" for short. A "daemon" is a special case of a
"tool" which is loaded at login and always runs in the background.
>
What I don't understand is how to create the
>
run loop, which, when using application kit, is created automatically.
You are on the right track with the code you posted.
You need to (1) create the run loop (2) add input(s) and (3) tell it to run.
Functions such as CFRunLoopAddSource or NSRunLoop methods like addPort:,
addTimer:, etc. have the side effect of creating a "current" run loop if one
does not exist, so this takes care of both (1) and (2). It looks like you
can do this in your -startServer method.
(3) is done in your next line; the "?" is "run":
[[NSRunLoop currentRunLoop] run] ;
It should work.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden