| Author |
Irregular messaging between server and telnet client.
|
rewati raman
Ranch Hand
Joined: May 22, 2010
Posts: 62
|
|
Hi
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.
|
 |
Andrey Kozhanov
Ranch Hand
Joined: Mar 12, 2010
Posts: 79
|
|
Hi!
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.
|
 |
 |
|
|
subject: Irregular messaging between server and telnet client.
|
|
|