O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Runloop Chatter Server

GUI applications aren’t the only ones that can benefit from being runloop-driven. Here you will make some changes to chatterserver so that it uses a runloop at its core rather than select(). You’ll perform some surgery to existing functions and add some new ones. There won’t be any changes to the fundamental data structures or architecture of chatterserver. While the behavior of the server won’t change, the changes you do make will set the stage for adding Bonjour support in a later chapter.

Make a copy of chatterserver.m and name it chatterserver-runloop.m. The first thing to change is the signature and the first several lines of AcceptConnection. The runloop will call accept() for us, so all we need to do is get the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required