threads and sockets excercise