0

I am using apache-commons-net TelnetClient class for my telnet connection to cisco router. This code EchoOptionHandler(false, false, false, false) should disable echo-option for this connection. But it doesn't disable! Wireshark shows that router sends "will echo", then my telnet client sends "don't echo" and then router sends "won't echo". This telnet commands should mean no echoing, right? But my client receives all sent commands! How is it possible?

DenisM
  • 223
  • 4
  • 13
  • What exactly do you mean by "receives all sent commands"? – kittemon Apr 27 '12 at 19:43
  • If i send character it comes back. And then if enter was pressed, router response with appropriate message. – DenisM Apr 28 '12 at 11:39
  • Ok, so that indicates that your client is in character mode, rather than line mode. Have you tried it in line mode? (Technically it shouldn't make any difference, but there are a number of reasons it might affect things.) – kittemon Apr 28 '12 at 14:39
  • How can i put apache-commons-net TelnetClient in "line mode"? What does it mean, this "line mode" and "character mode"? – DenisM Apr 28 '12 at 16:38
  • Character mode means that the client is sending characters you type one at a time, as you type them. Line mode means that the client holds them until you press enter, then sends them all at once. Echo is usually used in conjunction with character mode, but not line mode. – kittemon Apr 29 '12 at 01:12
  • This [answer to a related post](http://stackoverflow.com/a/6534367/1243958) may be of help. – kittemon Apr 29 '12 at 01:34
  • I tried this approach, but it didn't work( Any other ideas? – DenisM Apr 29 '12 at 08:34

1 Answers1

0

I use and works:

tc = new TelnetClient("unset localecho");