class Telnet::Descriptor
- Telnet::Descriptor
- Reference
- Object
Overview
Descriptor class wraps an IO object and provides a parser for telnet protocol through the Parser class. It also contains the IO loop for reading data from the socket when it is a client type. The IO loop is started in its own fiber when the connection is established.
Defined in:
telnet/descriptor.crConstant Summary
-
CONNECT_TIMEOUT =
5
Constructors
Class Method Summary
Macro Summary
-
method_missing(call)
Forward missing methods to the TCPSocket object
Instance Method Summary
- #close
-
#connect(address : String, port : Int32 = 23) : Bool
Connect to a remote server Descriptor ends up calling
TCPSocket#connect
to establish the connection and we are wrapping the call so we can set@connected
to true if the connection is successful. -
#connected? : Bool
If the descriptor is a
Telnet::Client
instance this allows us to know if we're connected to a server yet. - #finalize
-
#type : Type
The type of descriptor
-
#write(data : UInt8)
Write a byte to the socket
-
#write(data : Array(UInt8), escape : Bool = true)
Write an array of bytes to the socket
- #write_command(data : Array(UInt8))
- #write_command(data : Slice(UInt8))
Constructor Detail
Class Method Detail
Macro Detail
Instance Method Detail
Connect to a remote server
Descriptor ends up calling TCPSocket#connect
to establish the connection and we are wrapping the call so
we can set @connected
to true if the connection is successful.
address
is the address of the remote server
port
is the port to connect on (default is 23)
If the descriptor is a Telnet::Client
instance this allows us to know if we're connected to a server yet.
This is not used by a server connection. The server connection status is determined by TCPSocket#closed?