When we do socket program, the most popular way is of PPC/TPC mode ( Process Per Connection / Thread Per Connection ). But the mode has some drawbacks, for instance, it will consum too much memory and CPU for context switch when creating more than hundreds of connections. epoll is good solution to deal with that.
The following URL is a good explaintion about epoll.
How to use epoll? A complete example in C
And here is a complete examle of using epoll in socket program.