Indy 9
TIdTelnetServer
Hierarchy, Properties, Methods, Events, See Also, Unit: IdTelnetServer
Specifies a Telnet Protocol server architecture.
TIdTelnetServer = class(TIdTCPServer)
Unit
IdTelnetServer
Description
TIdTelnetServer is sever 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)

  • 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)

The TELNET Protocol provides a general communications facility to allow a standard method of interfacing terminal devices and terminal-oriented processes.

Telnet is used to connect to a remote computer system and allow the client to act as a dumb terminal on that system.


TIdTelnetServer.DefaultPort
TIdTelnetServer, See Also
Default port number for the server.
property DefaultPort: integer;
Description
DefaultPort is a published property in TIdTelnetServer that identifies the default port number for the server, as described in the Telnet Protocol specification. DefaultPort is the value used in the Port number for listener threads created on the server.

The default value for DefaultPort is IdPORT_TELNET, as assigned in the Create constructor.


TIdTelnetServer.LoginAttempts
TIdTelnetServer
Number of failed logins permitted.
property LoginAttempts: Integer;
Description
LoginAttempts is an Integer property used to indicate the number of unsuccessful login attempts permitted for a connection before the connection is terminated.

LoginAttempts is used in DoConnect to determine the number maximum number of login attempts allowed in the method.

By default, a new connection is allowed 3 unsuccessful connection attempts before termination.


TIdTelnetServer.LoginMessage
TIdTelnetServer
Represents the login message for a new connection.
property LoginMessage: String;
Description
LoginMessage is a String property used to inform the TELNET connection that the server is ready to accept parameter values for Username and Password.

LoginMessage is written to the peer connection after option negotiation has been completed.

The default value for LoginMessage is the constant value RSTELNETSRVWelcomeString, or "Indy Telnet Server".


TIdTelnetServer.Create
TIdTelnetServer
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the object instance, and relies on the inherited Create method to initialize the TELNET server.

Create also initializes properties for the server to their default values including:


TIdTelnetServer.DoAuthenticate
TIdTelnetServer
Implements user authentication for a connection.
function DoAuthenticate(AThread: TIdPeerThread; const AUsername: string; const APassword: string): boolean; virtual;
Parameters
AThread: TIdPeerThread
The connection to authenticate.
const AUsername: string
The authentication user name.
const APassword: string
THe authentication password.
Description
DoAuthenticate is a Boolean function used to implement authentication for a TELNET connection.

DoAuthenticate requires a procedure assigned to the OnAuthentication event handler, or an exception will be raised.

DoAuthenticate triggers the OnAuthentication event using the specified parameters to perform authentication processing.

DoAuthenticate returns True when authentication is successful, or False when authentication has failed.

DoAuthenticate is called from DoConnect to perform authentication for a new TELNET connection.


TIdTelnetServer.DoConnect
TIdTelnetServer
Opens a connection on the server for the peer.
procedure DoConnect(AThread: TIdPeerThread); override;
Parameters
AThread: TIdPeerThread
The peer thread with the connection to be opened.
Description
DoConnect is a procedure used to open a TELNET connection from a peer thread. DoConnect relies on the inherited DoConnect method to handle the basic TCP connection capabilities supported by the server.

DoConnect initializes the Data property to contain an instance of TTelnetData for the connection.

DoConnect calls DoNegotiate to perform TELNET option negotiation for the connection.

DoConnect sends the LoginMessage, when present, to identify the server that is the endpoint for the connection.

When an OnAuthentication event handler has been assigned to the server property, DoConnect will read username and password from the peer connection and store the values in Data. DoAuthentication is called using the user name and password values. DoConnect will attempt to authenticate the connection until LoginAttempts is exceeded.

If an exception occurs in DoConnect, the exception message is written to the peer connection and the exception is discarded.


TIdTelnetServer.DoNegotiate
TIdTelnetServer
Implements TELNET option negotiation.
procedure DoNegotiate(AThread: TIdPeerThread); virtual;
Parameters
AThread: TIdPeerThread
The peer thread to perform option negotiation.
Description
DoNegotiate is a procedure used to implement the OnNegotiate event handler for a peer connection.

DoNegotiate requires a procedure assigned to the OnNegotiate event handler to allow option negotiate to be performed for the connection.


TIdTelnetServer.OnAuthentication
TIdTelnetServer
Specifies the event handler for connection authentication.
property OnAuthentication: TAuthenticationEvent;
Parameters
AAuthenticated
Indicates authentication success.
APassword
The authentication password.
AThread
The connection to authenticate.
AUsername
The authentication user name.
Description
OnAuthentication is a TAuthenticationEvent event handler used to respond to authentication event notifications when AUsername and APassword have been submitted by the client connection.

When AAuthenticated is True, authentication for the client connection was successful. When AAuthenticated is False, authentication has failed, LoginAttempts has been exceeded, or an exception has occurred.

OnAuthentication is triggered from DoConnect and DoAuthenticate.


TIdTelnetServer.OnNegotiate
TIdTelnetServer
Specifies the event handler for TELNET option negotiation.
property OnNegotiate: TIdTelnetNegotiateEvent;
Parameters
AThread
The peer thread triggering the event.
Description
OnNegotiate is a TIdTelnetNegotiateEvent event handler used to respond to event notifications for the connection in the peer thread.

OnNegotiate is called from DoConnect to initialize the TELNET protocol options for the connection.


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