|
Steve
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
When the client send numbers to the server, is it asynchronous or synchronous (client waits till server return)?
The send number to server feature should be done in another thread.
or use print statements on both sides to see where things get when the application hangs
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Since you mentioned synchronous, then you should also check whether it is the client (GUI) waiting for the server return that "tends" to freeze (maybe server side) or nothing to do with the server code.
Steve
Anders Kviback wrote:I have done the print statements and it helps out a bit but not the whole way. (what do you mean with state of sockets?)
Steve
Steve
Should be written as:
int serverCalc = tal2.calculate();
boolean answer = (serverCalc == kSvar);
out.writeBoolean(answer);
out.flush();
Steve
Anders Kviback wrote:... it freezes occasionaly.
...
So, it stops at some of these points. Why?
Anders Kviback wrote:MathNumber is not a method. It is a constructor. That's why it starts with a capital letter.
Steve
Steve Luke wrote:Unknown. You have to put system outs before every line and after every line to see exactly where it goes. and that includes catch() clauses. My guess is that you are still getting some exception in the server, not handling it well, and not sending a response to the client that an error occurred. So the client waits for a response and doesn't get it.
Steve
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|