Using awMainLoop
The awMainLoop function is similar to awDispatch, except that it enters an event loop that will continue to receive and dispatch events until awStopMainLoop is called. The subscribe3.c sample application provides an example of how to use awMainLoop.