Internet Direct (Indy)
Home
PreviousUpNext
TIdStackBSDBase.ReceiveFrom Method

Receives a datagram using a socket handle and stores the source address.

Pascal
function ReceiveFrom(
    ASocket: TIdStackSocketHandle; 
    var VBuffer: TIdBytes; 
    var VIP: string; 
    var VPort: Integer; 
    const AIPVersion: TIdIPVersion = ID_DEFAULT_IP_VERSION
): Integer; override;
Parameters 
Description 
ASocket 
Socket handle for the operation.
 
VIP 
IP address for the remote network.
 
VPort 
Port number for the remote network.
 
AIPVersion 
IP address family for the IP address. 
ABuffer 
Buffer used to store values read from the socket handle.
 

Integer - Number of bytes read from the socket handle.

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

ReceiveFrom reads data from the socket handle in ASocket, and stores the remote destination IP address and port number in VIP and VPort. 

ReceiveFrom checks for a socket error during the operation, and sets the return value to True when no socket error is detected. 

The return value for the method is the nNumber of bytes read from the socket handle, or 0 (zero) when the connection has been closed gracefully.

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.