Synchronous socket between server and client using multi thread