C programming, TCP/IP Socket, MySQL , pthreads