commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thufir <>
Subject TelnetClient waitfor, ready and EOL
Date Thu, 29 Aug 2013 18:47:59 GMT
I'm trying to use TelnetClient and BufferedReader to read lines as they 
come in, as the WeatherTelnet sample does.  However, while it's easy 
enough to read each char, I can't seem to get the last line.

What's the correct idiom to using TelnetClient to read each and every 
line?  Surely this is part of the API for TelnetClient and I'm just not 
seeing it. (?)

"As Jean mentioned, this is a shortcoming of using the BufferReader if 
you know your input never ends with either the linefeed '\n' or carriage 
return '\r' character. After your while loop you may want to use the 
ready() method to test if there is indeed more text after the last line 
read, and use one of the read() methods to pull in that remaining text. 
Or, substitute another text reader for BufferReader all together."



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message