tls?

tls?() Instance Public methods true if this object uses SMTP/TLS (SMTPS). ssl?

new

new(options) Class Public methods Creates a new Net::Telnet object. Attempts to connect to the host (unless the Proxy option is provided: see below). If a block is provided, it is yielded status messages on the attempt to connect to the server, of the form: Trying localhost... Connected to localhost. options is a hash of options. The following example lists all options and their default values. host = Net::Telnet::new( "Host" => "localhost", # default: "localho

binmode

binmode(mode = nil) Instance Public methods Turn newline conversion on (mode == false) or off (mode == true), or return the current value (mode is not specified).

binmode=

binmode=(mode) Instance Public methods Turn newline conversion on (false) or off (true).

close

close() Instance Public methods Closes the connection

cmd

cmd(options) Instance Public methods Send a command to the host. More exactly, sends a string to the host, and reads in all received data until is sees the prompt or other matched sequence. If a block is given, the received data will be yielded to it as it is read in. Whether a block is given or not, the received data will be return as a string. Note that the received data includes the prompt and in most cases the host's echo of our command. options is either a String, specified

login

login(options, password = nil) Instance Public methods Login to the host with a given username and password. The username and password can either be provided as two string arguments in that order, or as a hash with keys âNameâ and âPasswordâ. This method looks for the strings âloginâ and âPasswordâ from the host to determine when to send the username and password. If the login sequence does not follow this pattern (for instance, you are connecting to a service other than telnet),

preprocess

preprocess(string) Instance Public methods Preprocess received data from the host. Performs newline conversion and detects telnet command sequences. Called automatically by waitfor(). You should only use this method yourself if you have read input directly using sysread() or similar, and even then only if in telnet mode.

print

print(string) Instance Public methods Sends a string to the host. This does not automatically append a newline to the string. Embedded newlines may be converted and telnet command sequences escaped depending upon the values of telnetmode, binmode, and telnet options set by the host.

puts

puts(string) Instance Public methods Sends a string to the host. Same as print(), but appends a newline to the string.