get_char/1 | Gets a single character from a telnet session. |
get_char/2 | |
get_line/1 | Gets a line of text from a telnet session. |
send/2 | Sends some text to a telnet session. |
send_file/2 | Sends a text file to a telnet session. |
server/3 | Spawned by start/4 to handle the telnet server. |
start/4 | Starts a telnet server on the given port. |
get_char(Telnet::pid()) -> {ok, char()} | {error, Reason}
Gets a single character from a telnet session.
get_char() -> term()
get_line(Telnet::pid()) -> {ok, string()} | {error, Reason}
Gets a line of text from a telnet session.
send(Telnet::pid(), Text::string()) -> ok | {error, Reason}
Sends some text to a telnet session.
send_file(Telnet::pid(), FileName::filename()) -> ok | {error, Reason}
Sends a text file to a telnet session.
server(Socket::socket(), Module::atom(), Function::atom()) -> never_returns
Spawned by start/4
to handle the telnet server.
start(Module::atom(), Function::atom(), Port::integer(), MaxCon::integer()) -> pid()
Starts a telnet server on the given port. When a connection is made,
Module:Function/1
is called and passed the pid of the
telnet server. This function can then use functions like
send
and get_line
, and/or it can directly
receive the following messages:
{Telnet::pid(), close}
, which means the socket was closed
by the client; and
{Telnet::pid(), {byte, integer()}}
, which means a byte
was successfully received.
Generated by EDoc, Feb 18 2008, 06:48:07.