This is basically a type of common problem, made more difficult by the fact that the fault may lie in either the client, or the server, or both. The first step is to try and isolate the cause of the problem, by checking whether the server is responding correctly.
If we\'re writing a TCP service, then you can telnet to the port the server uses, and check to see if it is responding to data. If so, then the fault is more than likely in the client, and if not, we\'ve found our problem. A debugger can be very helpful in tracking down the precise location of server errors. We could try jdb, which comes with JDK, or use an IDE\'s debugger like Visual J++ or Borland JBuilder.
If our fault looks like it is in the client, then it can often be caused by buffered I/O. If we\'re using a buffered stream, or a writer, We may need to manually flush the data. Otherwise, it will be queued up but not sent, causing both client and server to stall. The problem can even be intermittent, as the buffer will flush sometimes but not other times.