Internet Direct (Indy) Version 9.0.1 Beta
|
function Readable(AMSec: Integer): boolean;
Readable returns True when the socket descriptor is ready for read operations using Recv, RecvFrom, or Accept.
Readable will raise an EIdConnClosedGraceful exception if HandleAllocated contains False.
Readable detects the use of a TIdAntifreeze instance in an application. When present, Readable yields processing cycles during the lifetime of the method call to the TIdAntifreeze.DoProcess method.
When AMSec is IdTimeoutInfinite, Readable uses the IdleTimeout value in TIdAntifreeze as its time-out value. Readable will continue executing until the socket is ready to read.
When AMsec is larger than the IdleTimeout value in TIdAntifreeze, Readable is called using the difference between the two time-out values. If the socket is ready to read, no further processing is performed. If the socket is not ready to read, the time-out value is set to the IdleTimeout value in TIdAntifreeze and Readable is called again to determine the socket status. Readable yields processing cycles to the TIdAntifreeze.DoProcess method if the socket is still not ready to read.
Readable does not yield processing cycles when an instance of TIdAntifreeze has not been used in the application.