The following is a server that implement an "add service" using the poll system call to concurrently handle multiple clients.
The complete source code and Makefile is available as a zip file.