Internet Direct (Indy) Version 9.0.1 Beta
TIdTCPConnection.CheckForGracefulDisconnect
Determines if the peer has been gracefully disconnected.

procedure CheckForGracefulDisconnect(const ARaiseExceptionIfDisconnected: Boolean); virtual;
Parameters
const ARaiseExceptionIfDisconnected: Boolean = True
Raise an exception when the connection is closed. Default value is True.

Description
CheckForGracefulDisconnect is a procedure used to determine if the connection has been closed gracefully.

CheckForGracefulDisconnect calls ReadFromStack using the value in ARaiseExceptionIfDisconnected and a 1 millisecond timeout to verify that the socket handle is ready to perform a read operation.

ReadFromStack updates the ClosedGracefully property and performs exception handling as specified in ARaiseExceptionIfDisconnected.