aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes Irregular messaging between server and telnet client. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Irregular messaging between server and telnet client." Watch "Irregular messaging between server and telnet client." New topic
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Irregular messaging between server and telnet client.
 
Similar Threads
Connection Refused Error
Issue with simple multi-threaded Echo server and client program
mutiple socket connection issue
Multithreading client socket throws Stream corrupted exception