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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access