We are using PuTTY's PLINK to programatically communicate with generic
telnet and SSH servers. We need plink's ability to send and receive
via stdin and stdout; we cannot use the Windows telnet client due to
the need for communicating with the process via stdin and stdout (a
shared console will not work in our application). We must also have
open source (or BSD licensed code) and cannot have dependencies upon
Cygwin.
For unit testing of our Windows code, I am connecting to a local
Windows 2003 telnet service (tlntsvr). However, I can only issue one
command: when the second command is issued, the terminal replies with
"What? " and waits for some input. Regardless of what is input at this
point, the plink process will terminate. The "What? " message
*appears* to be generated by the server's instance of CMD.EXE (I cannot
find the text "What?" in plink nor in tlntsvc.exe; only in cmd.exe).
The same problem does not happen with the Windows telnet client, nor
does it happen if I communicate with the telnet server via winsock (no,
I don't really want to write my own client). Also, I do not seem to
have any problems communicating with other telnet servers. However,
this bug makes me very nervious.
Does anyone know of a fix or a work-around? Anyone have more
information on what is going on? Or, perhaps, a recommendation on
another (very lightweight) telnet client? Or combined ssh/telnet
client?
Thanks much!
Jim
I doubt that Putty implements NTVT.
Jeffrey Altman
I'm sure there's a simpler solution, but if you *really* get stuck then
you could try the telnet client in my terminal emulator package
(http://members.optusnet.com.au/~rosshigson/terminal.htm).
The source is fully GPL, but is written in Ada. The telnet program was
included mainly to demonstrate the terminal emulator, but I find I use
it a lot as it works much better than anything else I've tried. It
implements a simple Network Virtual Terminal (in the "telnet_terminal"
package) that takes input and output from a terminal emulator window,
but if you have some familiarity with Ada it would be easy to modify it
to uses stdin and stdout instead.
> (no, I don't really want to write my own client)
Well, after much research this turned out to be the best solution and
seems to be working well.
Thanks for the help,
JH