revise part of tcpsocket, allowing only one client socket connection at one time to ensure the connection is available.