Internet Direct (Indy)
Home
PreviousUpNext
TIdTCPConnection.Disconnect Method ()

Disconnects the peer connection.

Pascal
procedure Disconnect; overload;

Disconnect is a procedure used to disconnect from the peer for the connection. 

If the connection is still Connected, Disconnect triggers a hsDisconnecting status notification prior to closing the IOHandler for the connection. If the connection is not Connected, no action is performed. 

When FreeIOHandlerOnDisconnect contains True, the IOHandler for the connection will be freed and FreeIOHandlerOnDisconnect is reset to False. 

If the connection was Connected on entry to the method, Disconnect triggers the OnDisconnected event handler and sends a hsDisconnected status notification for the connection. 

Many descendant classes override the Disconnect method to provide termination commands and response handling required by a specific protocol. 

If you simply need to close a connection, you probably should call the close method in the IOHandler or Socket (when assigned).

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.