Internet Direct (Indy) Version 9.0.1 Beta
TIdTelnetServer.DoConnect
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.