You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gennaro Leo <ge...@ericsson.com> on 2014/01/23 11:24:11 UTC
[net] ETX in Telnet stream and available() method
Hi all,
I'm trying to perform a telnet bridge with my Java code.
First I connect to SERVER1 via telnet, then from its terminal I connect to SERVER2 via telnet.
When I want to exit the telnet connection on SERVER2 (the only way is EXIT;) I get the stream as reported below.
The ETX character causes the InputStream.available() method read until the < prompt and I can't get the prompt of SERVER1 again.
Does this ETX causes a break in the stream? How can I read until the > prompt?
Thank you
Gennaro
C:\>telnet SERVER1 23
...
C:\WINNT\Profiles\Administrator>telnet SERVER2 8010
Connecting to SERVER2:8010... Connected!
USERCODE: admin
PASSWORD:
DOMAIN:
MA MML Page 1
ETX<exit;
LOGGED OFF
ETX<
Connection to server lost.
C:\WINNT\Profiles\Administrator>