example java client to communicate with the server