java version of TCPClient for mobile computing