Irregular messaging between server and telnet client.
Joined: May 22, 2010
I have made a server program that can be used to chat with a telnet client. Here is the code. There is a problem with it.
the message between server and client is irregular and i am not able to understand it. I am attaching the output below.
Joined: Mar 12, 2010
Your problem is on 52nd line of code. It is said in java documentation:
public boolean hasNextLine() Returns true if there is another line in the input of this scanner. This method may block while waiting for input.
This is exactly what happening with your server - it's execution does not proceed until user enters something on server side.