The basic code to start a socket server in C is as follows.
On top of this basic method of listening to a linux socket I build a library that allows you to register and handle routes.