Internet Direct (Indy)
|
Receives data from the remote connected on a socket handle.
function Receive( ASocket: TIdStackSocketHandle; var VBuffer: TIdBytes ): Integer; override;
Parameters |
Description |
ASocket |
Socket handle for the operation. |
ABuffer |
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:
Bytes |
Condition |
0 |
Connection has closed gracefully |
>0 |
Number of bytes receive on the socket handle. |
Other conditions may raise an Exception pertinent to the error.
Receive checks to ensure that the Recv() API call does not return an Id_SOCKET_ERROR return value indicating an error during the operation.
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved. Website http://www.indyproject.org. Post feedback to the Indy Documentation newsgroup. |