TCP code is now working: need to create a client socket per call and to close everything