CLI over Sockets?

Cliff Daniel cdaniel at Level3.net
Thu Apr 6 15:50:44 EDT 2000


> It's dead easy to write such a tool though: look at telnetlib for some good
> examples. I ended up overriding the interact() method to add my logging, but
> you still get all the protocol stuff for free. (telnet is more than just a
> TCP socket, you see.) I'd guess that it isn't too much trouble to add
> readline and your own completer function (if necessary, that last bit) but
> i'm not sure if readline works properly with the select() method interact
> uses... you might want to use mt_interact or something similar instead.

   telnetlib provides no helpful information in implementing a daemon
base CLI in which someone uses 'telnet' to connect.  What I'm looking
to implement is just like Cisco's IOS CLI.  The socket code is trivial
but but the vt100 emulation, to me anyway, is non-trivial.  Getting the
client into character mode is a cinch, but implementing the command
line editting features (left arrow, insert, tab, ?, etc...) seems to be
a little more involved.  Basic interaction within the sockets is just
a function of recv()/send() but with that you lack any useful cli
functions.

Regards,
Cliff




More information about the Python-list mailing list