Indy 9
TIdTelnet
Hierarchy, Properties, Methods, Events, See Also, Unit: IdTelnet
Implements a TELNET protocol client.
TIdTelnet = class(TIdTCPClient)
Unit
IdTelnet
Description
TIdTelnet is a client implementation of the TELNET Protocol as described in the Internet Standards documents:

  • RFC 854 - TELNET Protocol Specification (http://www.rfc-editor.org/rfc/rfc854.txt)

  • RFC 855 - TELNET Option Specifications (http://www.rfc-editor.org/rfc/rfc855.txt)

  • RFC 856 - TELNET Binary Transmission (http://www.rfc-editor.org/rfc/rfc856.txt)

  • RFC 857 - TELNET Echo Option (http://www.rfc-editor.org/rfc/rfc857.txt)

  • RFC 858 - TELNET Suppress Go Ahead Option (http://www.rfc-editor.org/rfc/rfc858.txt)

  • RFC 859 - TELNET Status Option (http://www.rfc-editor.org/rfc/rfc859.txt)

  • RFC 860 - TELNET Timing Mark Option (http://www.rfc-editor.org/rfc/rfc860.txt)

  • RFC 861 - TELNET Extended Options: List Option (http://www.rfc-editor.org/rfc/rfc861.txt)

  • RFC 1700 - Assigned Numbers (http://www.rfc-editor.org/rfc/rfc1700.txt)

TIdTelnet is a TIdTCPClient descendant used to transmit data with interspersed TELNET control information.

TIdTelnet provides a general, eight-bit byte-oriented communications facility designed to interface terminal devices and terminal-oriented processes. The TELNET protocol may also be used for terminal-to-terminal communication ("linking") and process-to-process communication (distributed computation).

TIdTelnet also provides negotiated options that allows additional services over and above those available within an NVT (Network Virtual Terminal).


TIdTelnet.OnConnect
TIdTelnet, See Also
Specifies the connection event handler.
property OnConnect: TNotifyEvent;
Description
OnConnect is a TClientEvent event handler that responds to client connection requests. OnConnect is called from the Connect method, prior to opening the socket connection and assigning the TIdTelnetReadThread used to read data for the TIdTelnet object.

Applications should assign a procedure to the OnConnect event handler to respond to connection requests or perform special processing prior to opening the socket connection.


TIdTelnet.OnDisconnect
TIdTelnet, See Also
Specifies the event handler for disconnection requests.
property OnDisconnect: TNotifyEvent;
Description
OnDisconnect is a TIdTelnetCommandEvent event handler that responds to client disconnection requests. OnDisconnect is triggered from the Disconnect method after terminating the TelnetThread and closing the socket connection.

Applications should assign a procedure to the OnDisconnect event handler to perform processing required after closing the socket connection.


TIdTelnet.TelnetThread
TIdTelnet, See Also
Specifies the thread used to read data and commands for the TELNET client.
property TelnetThread: TIdTelnetReadThread;
Description
TelnetThread is an instance of TIdTelnetReadThread that is used to read data and commands for the TIdTelnet object. All data from the host is read using this thread. The OnDataAvailable and OnTelnetCommand event handlers are called as a result of data being received via this thread.

TelnetThread is created when the client connects to the host, and terminated when the client disconnects from the host.


TIdTelnet.Terminal
TIdTelnet
Specifies the terminal identification string for the TELNET client.
property Terminal: string;
Description
Terminal is a String property that contains the terminal identification string used to identify the terminal type in suboption negotiations. The terminal type information is an NVT ASCII string with a maximum length of 40 characters, as described in RFC 1700.

Note: Indy does not provide terminal emulation other than a dumb terminal NVT implementation. Any non-null string value can be used in Terminal.


TIdTelnet.Connect
TIdTelnet, See Also
Connects the TELNET client to a host.
procedure Connect(const ATimeout: Integer = IdTimeoutDefault); override;
Description
Connect is an overridden procedure in TIdTelnet used to connect the TELNET client to a host computer identified by the Host and Port properties.

Connect triggers the OnConnect event prior to using the inherited Connect method to open the socket connection. If the client is connected, the TelnetThread property is initialized.

Connect can raise an EIdException exception with the constant message RSTELNETCLIConnectError if an EIdSocketError occurs.


TIdTelnet.Create
TIdTelnet, See Also
Constructor for the new TIdTelnet instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the new TIdTelnet object instance. Create relies on the inherited Create constructor, and initializes the following private and public properties:

  • Port - Set to the value IdPORT_TELNET (Decimal 23).

  • State - Set to the value tnsData.

  • SentDoDont - Set to the null string value (Decimal 0).

  • SentWillWont - Set to the null string value (Decimal 0).

  • ReceivedDoDont - Set to the null string value (Decimal 0).

  • ReceivedWillWont - Set to the null string value (Decimal 0 ).

  • Terminal - Set to the string value 'dumb'.

  • IamTelnet - Set to False.

TIdTelnet.Disconnect
TIdTelnet, See Also
Disconnects the client from the host.
procedure Disconnect; override;
Description
Disconnect is an overridden procedure in TIdTelnet that instructs the TelnetThread to terminate, and calls the inherited Disconnect method. Disconnect also triggers the TClientEvent event used by the OnDisconnect event handler.

TIdTelnet.SendCh
TIdTelnet
Sends a character to the host.
procedure SendCh(Ch: Char);
Parameters
Ch: Char
Character to send to the host.
Description
SendCh is a procedure used to send a character from the client to the host. SendCh examines the character in Ch to determine if carriage returns are written to the host (when IamTelnet is True) using the inherited WriteLn method, or omitted in favor of the inherited WriteLn method.

TIdTelnet.OnDataAvailable
TIdTelnet, See Also
Specifies the event handler for processing data received from the host.
property OnDataAvailable: TIdTelnetDataAvailEvent;
Description
OnDataAvailable is the TIdTelnetDataAvailEvent event handler used to handle data received from the host. OnDataAvailable processes and applies the data read with TelnetThread.

Applications must assign a procedure to the OnDataAvailable event handler to allow the TIdTelnet object to determine how data from the host is applied.


TIdTelnet.OnTelnetCommand
TIdTelnet, See Also
Specifies the TELNET command event handler.
property OnTelnetCommand: TIdTelnetCommandEvent;
Description
OnTelnetCommand is the TIdTelnetCommand event handler used to respond to TELNET commands and status changes received by the TIdTelnet client.

Applications should assign a procedure to the event handler in order to respond to specific TELNET commands, or to perform TELNET options; i.e. tncNoLocalEcho, tncLocalEcho, or tncEcho.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.