Module ce_telnet

Rudimentary TELNET server in Erlang.

Description

Rudimentary TELNET server in Erlang.

Function Index

get_char/1Gets a single character from a telnet session.
get_char/2
get_line/1Gets a line of text from a telnet session.
send/2Sends some text to a telnet session.
send_file/2Sends a text file to a telnet session.
server/3Spawned by start/4 to handle the telnet server.
start/4Starts a telnet server on the given port.

Function Details

get_char/1

get_char(Telnet::pid()) -> {ok, char()} | {error, Reason}

Gets a single character from a telnet session.

get_char/2

get_char() -> term()

get_line/1

get_line(Telnet::pid()) -> {ok, string()} | {error, Reason}

Gets a line of text from a telnet session.

send/2

send(Telnet::pid(), Text::string()) -> ok | {error, Reason}

Sends some text to a telnet session.

send_file/2

send_file(Telnet::pid(), FileName::filename()) -> ok | {error, Reason}

Sends a text file to a telnet session.

server/3

server(Socket::socket(), Module::atom(), Function::atom()) -> never_returns

Spawned by start/4 to handle the telnet server.

start/4

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.