Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chowjyc

macrumors newbie
Original poster
Hello everyone!

I have no previous MAC Programming experience (nor much C++ experience) but I have to pull something off in a short time, can anyone explain to me what the following does?

EventLoopTimerRef idleEventLoopTimer;
InstallEventLoopTimer (GetCurrentEventLoop (), kEventDurationSecond / 25., kEventDurationSecond / 25., idleTimerProc, effect, &idleEventLoopTimer);

RunAppModalLoopForWindow (window);
RemoveEventLoopTimer (idleEventLoopTimer);

And any tutorial pointing to CFnetworking is cool, I want to implement a server socket inside this loop...

Apple's CFNetwork tutorials is very hard to understand at the moment because it has no sample code.

Thanks!

Chowjyc
 
It sets up a timer to run every 0.04 seconds, then runs a blocking modal window loop. You can look up these functions in the docs for more info.

A quick google didn't show any good CFNetwork tutorials, but you don't have to use that for sockets. You can use any other C/C++ based API.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.