This is the code :
server.c
is the main file starting the 2 threads and
pachet.h
contains the buffer manipulation routines.. the code might be very messy .. Thanks for all that try to help me.