TCPServer is now generic and cleaned up the code.