Step 1. Check server
Try and isolate the cause of the problem, by checking whether the server is responding correctly.
If you'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, you' ve found your problem.
Step 2. Use Debugger
A debugger can be very helpful in tracking down the precise location of server errors.
If your fault looks like it is in the client, then it can often be caused by buffered I/O.
If you're using a buffered stream, or a writer (such as PrintWriter), you 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 (when it becomes full) but not other times.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.