Internet Direct (Indy) Version 9.0.2 Beta
TIdRawBase.ReceiveBuffer
Reads and buffers data from the socket connection.

function ReceiveBuffer(var ABuffer; const AByteCount: Integer; ATimeOut: integer): integer;
Parameters
var ABuffer
Buffer for data read from the connection.

const AByteCount: Integer
Number of bytes to read in to the buffer.

ATimeOut: integer = -1
Timeout value. Default value is -1.

Returns
Integer - Number of bytes read from the connection.

Description
ReceiveBuffer is an Integer function used to receive and store data arriving on the socket connection.

ABuffer is the destination for data read from the connection. AByteCount indicates the number of bytes anticipated to be read from the socket connection. ATimeOut is the number of milliseconds to wait for the Binding to become readable.

When ATimeOut is less than 0, the value in ReceiveTimeout is used.

If the specified timeout period elapses, AByteCount is less than 1, or ABuffer is nil, then the return value for ReceiveBuffer is 0.