Telnet Client fails to detect server disconnect during machine reboot
posted 5 years ago
I have written a telnet client that establishes a telnet session with the help of org.apache.commons.net.telnet.TelnetClient to the server and it monitors a particular file. It reads the latest contents written to that file using the tail -F command . The problem I am facing is that the blocking call inputStream.read(int) does not throw an exception when the telnet server machine reboots, but when network cable is unplugged an IOException is thrown.
Due to this behavior my program fails to receive the updates from the file after a machine reboot. Even the telnetClientObject.isConnected() returns true while the machine is rebooting.
Can you please suggest ways to rectify this issue?