Disconnect method

Attempt to gracefully disconnect from the server.

Applies to

ICHMllpConnection

Declaration

procedure Disconnect;

Description

A graceful disconnect implies a shutdown to the write end of the connection, and reading all data until the peer issues a close to its write end.

Note that the peer may not actually close the write end of its connection (although this is rare), which results in the connection never receiving the close event to signify that the connection is closed. In this situation, it is recommended that HardDisconnect be called to close the connection.

Function requires a running message loop (see RunMessageLoop).

Blocking: Function does not block.
Events: If the close succeeds (the peer closes the connection), a OnClientDisconnected event results. If an error occurs during the close operation, an OnClientErrorReceived event results, containing the error message indicating why the close attempt failed.


Chameleon Delphi Documentation