commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Boevink" <peter.boev...@alfa-ariss.com>
Subject RE: [net]TelnetClient.getInputStream.write() causes SocketTimeOutException immediately
Date Fri, 23 Sep 2005 07:16:56 GMT
Discovered that the next 'read' will throw a SocketTimeoutException if the previous 'read'
was more than 'SoTimeOut' ago.

For some strange reason there seems to be thrown this Exception in some 'background' process
even if i'm not reading anymore. The next time I want to read it looks like the exception
is passed through.

Does this have anything to do with the 'ReaderThread' of the TelnetClient?

> -----Original Message-----
> From: Peter Boevink 
> Sent: Thursday, September 22, 2005 2:09 PM
> To: commons-user@jakarta.apache.org
> Subject: [net]TelnetClient.getInputStream.write() causes
> SocketTimeOutException immediately
> 
> 
> Hi,
>  
> Making use of the commons.net.telnet.TelnetClient, we've set 
> up a connection with a Telnet Daemon.
> It works fine to send a message to the Telnet Daemon by using 
> an OutputStream and receive a response by using a BufferedReader.
> The SoTimeout was set to 15 seconds.
>  
> But if we haven't send/received anything for appr. 20 seconds 
> the next first message is send to the Outputstream, but the 
> BufferedReader.read() immediately throws a SocketTimeOutException!
> A retry 'read()' to the same instance of the BufferredReader 
> succeeds (without setting up a new connection).
>  
> Strange enough this does not happen if the Telnet 
> Communication 'sleeps' for less than 10 seconds, but only if 
> no communication has been there for longer than 20 seconds.
>  
> We receive the following stacktrace:
> Stacktrace {
>         java.net.SocketTimeoutException: Read timed out
>                  at 
> java.net.SocketInputStream.socketRead0(Native Method)
>                  at 
> java.net.SocketInputStream.read(SocketInputStream.java:129)
>                  at 
> java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
>                  at 
> java.io.BufferedInputStream.read(BufferedInputStream.java:201)
>                  at 
> java.io.FilterInputStream.read(FilterInputStream.java:66)
>                  at 
> java.io.PushbackInputStream.read(PushbackInputStream.java:120)
>                  at 
> org.apache.commons.net.io.FromNetASCIIInputStream.__read(FromN
> etASCIIInputStream.java:75)
>                  at 
> org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNet
> ASCIIInputStream.java:170)
>                  at 
> java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
>                  at 
> java.io.BufferedInputStream.read(BufferedInputStream.java:201)
>                  at 
> org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetI
> nputStream.java:114)
>                  at 
> org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInpu
> tStream.java:535)
>                  at java.lang.Thread.run(Thread.java:534)
> }
> 
> Does anybody have a clue in which direction to look for a solution?
>  
> Thanks,
> Peter
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message