An example of socket programming in C