[erlang-questions] How to build telnet client in Erlang?

李超 leechau@REDACTED
Thu Aug 15 02:14:19 CEST 2013


Hi, guys,


I am new for Erlang and I wonder if there are any libraries providing APIs like:


    Handle = telnet_module:connect(Ip, Port, Username, Password).
    {ok, Msg} = telnet_module:send(Handle, Command).
    {ok, close} = telnet_module:close(Handle).


Someone recommends ct_telnet, but this module seems mainly for test purpose (common test?) and associated closely with eunit. And I can't find any documents about how to configure the target server(including ip, port, username, password, etc.). Some examples show they are specified in a configuration file, but I am not quite sure.


There is also a getty.erl (http://ftp.sunet.se/pub/lang/erlang/examples/small_examples/getty.erl), but I find it is actually a tcp server and has nothing to do with connecting to a telnet server.


Maybe I can use "telnet" command of shell as the client and use open_port/port_command/port_close to communicate with remote peer?


Thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130815/ddd7479b/attachment.htm>


More information about the erlang-questions mailing list