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(FromNetASCIIInputStream.java:75)
at
org.apache.commons.net.io.FromNetASCIIInputStream.read(FromNetASCIIInputStream.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(TelnetInputStream.java:114)
at
org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.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