Re: CFSocket
Re: CFSocket
- Subject: Re: CFSocket
- From: Steve Sisak <email@hidden>
- Date: Fri, 23 Nov 2007 09:11:08 -0500
At 4:38 PM +0530 11/23/07, sunil prajapati wrote:
Problem comes when I use RunApplicationEventLoop(); at the end of
main function and launch my unix executable from "StartupItems" and
then logout the user ,my unix executable get quit after logout and
when i use while(1) then it does not quit. Even when I use Carbon API
"InstallEventLoopTimer" to create timer then also after logout my unix
executable get quit.
The Carbon API "SendAppleEventToSystemProcess" which is I m using for
restart(kAERestart),shutdown(kAEShutDown),logout (kAEReallyLogOut) the
system does not work.
I don't why all those things are happening when I launch my unix
executable from "StartupItems" ?
You're using the wrong APIs -- you can't use the Carbon API from a
daemon that doesn't have a graphical context -- you need to use
CoreFoundation.
Look at CFRunLoopRun() and CFRunLoopTimer() which are nearly
identical to the calls you're using.
Now for the bad news -- you can't use the AppleEvent APIs from a daemon.
HTH,
-Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >CFSocket (From: "sunil prajapati" <email@hidden>) |
| >Re: CFSocket (From: "sunil prajapati" <email@hidden>) |