Topic Path: Symbol Reference > Classes > TIdIOHandler Class > TIdIOHandler Methods > CheckForDisconnect Method
TIdIOHandler.CheckForDisconnect Method

Checks state and status information on the transport for the IO handler.

procedure CheckForDisconnect(
    ARaiseExceptionIfDisconnected: Boolean = True; 
    AIgnoreBuffer: Boolean = False
); virtual; abstract;
Indicates if exceptions are raised when the connection has closed prematurely.
Indicates if data in the Indy buffer is ignored when the connection has closed prematurely. 

CheckForDisconnect is an abstract virtual procedure in TIdIOHandler. CheckForDisconnect must be overridden in a descendant class to allow inspecting the status of the connection prior to or following a method call that performs an IO operation. 

CheckForDisconnect is used primarily to ensure that state and status properties for the IOHandler are synchronized with the underlying transport mechanism. 

In descendant classes, CheckForDisconnect must not delay when inspecting the connection. The method should not raise any exceptions directly, but may call methods in the descendant designed for that purpose when ARaiseExceptionIfDisconnected contains True. 

CheckForDisconnect may trigger the OnStatus event handler for the connection if the connection state has changed based on values detected in the method.

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