Topic Path: Symbol Reference > Classes > TIdTelnet Class > TIdTelnet Methods > Disconnect Method
TIdTelnet.Disconnect Method

Disconnects the client from the host.

procedure Disconnect(
    ANotifyPeer: Boolean
); override;
Indicates the socket should be immediately disconnected. 

Disconnect is an overridden procedure in TIdTelnet that instructs the TelnetThread to terminate, and calls the inherited Disconnect method. 

AImmediate indicates if the socket should be immediately disconnected in the inherited method. 

When TelnetThread has been assigned, the thread is terminated. 

Disconnect triggers the OnDisconnect event handler, and waits for the TelnetThread to complete. Resources allocated to TelnetThread are freed prior to exiting from the method. 

Use Connect to establish the connection for the TELNET client and to create the TIdTelnetReadThread for the TelnetThread property.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.