Topic Path: Symbol Reference > Classes > TIdStackDotNet Class > TIdStackDotNet Methods > Receive Method
TIdStackDotNet.Receive Method

Receives data from the remote connected on a socket handle.

function Receive(
    ASocket: TIdStackSocketHandle; 
    var VBuffer: TIdBytes
): Integer; override;
Socket handle for the operation.
Buffer used to store values read from the socket handle. 

Integer - Number of bytes read from the socket handle.

Receive is an overridden Integer function that implements the method used to access the Recv() API for the protocol stack implementation. 

ASocket is the socket handle to use for reading values from the remote connection. If no incoming data is available on the socket handle, Receive will block and wait for data to arrive or a timeout to occur. 

The return value for the method can included the following values under the associated conditions: 


Connection has closed gracefully 
Number of bytes receive on the socket handle. 


Any other condition will result in raising an Exception pertinent to the error. 

Exceptions occuring in the method are re-raised using either the EIdSocketError or EIdWrapperException exception types.

Receive does not make any provision for sending flags as arguments to the Recv() API. The flags parameter can be used to influence the behavior of the function invocation beyond the options specified for the associated socket.

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