TD2: Make the socket client multithreaded.