commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Diogo Saad" <>
Subject Net - TelnetClient with linux
Date Mon, 16 Aug 2004 19:06:32 GMT

	I made a classe called TelnetService that uses TelnetClient.
One of the methods of this class is read() it's supposed to read all
available data from telnet inputstream and return it.
I've been using this method for some time in my machine (win2k server)
with no problems.
Now I tryed to use it into a linux machine and I got some problems!!
When I try to read() all available data from telnet inputstream it
returns a splited string ( not with all the content)...
Feels like it's an assyncronous client, because if I debug the system,
add a breakpoint and wait for some time, it reads the whole content.
But if i run my app without debug it does not return it completly...
feels like i'm trying to read the content before the server sends the
full response! 
The source for read() is bellow
Can you help me?

 public String read() {
       StringBuffer sb = new StringBuffer();
       try {
          char ch = (char);
          while (telnetInput.available() > 0) {               
              ch = (char);
          return sb.toString();
       } catch (Exception e) {
       return null;

Diogo Saad
Inter Business Tecnologia e Servicos

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

View raw message