Internet Direct (Indy) Version 9.0.1 Beta
TIdSocketHandle.RecvFrom
Receive data from a socket and store the remote system address.

function RecvFrom(var ABuffer; const ALength: Integer; const AFlags: Integer; var VIP: string; var VPort: Integer): Integer; virtual;
Parameters
var ABuffer
Buffer for the read operation.

const ALength: Integer
Length of the read buffer.

const AFlags: Integer
Flags to modify socket options.

var VIP: string
IP Address of the remote connection.

var VPort: Integer
Port number of the remote connection.

Returns
Integer - Number of bytes read.

Description
RecvFrom is an Integer function used to read incoming data from a socket connection, and to store the address of the remote system in the variable parameters VIP and VPort.

RecvFrom is used on streaming sockets, to read all available data up to the size of the read buffer. RecvFrom can also retrieve Out-of-Band data on sockets configured using Id_SO_OOBINLINE in SetSockOpt. If no data is available on the socket, RecvFrom waits for data to arrive.

AFlags can be used to alter the behavior of the RecvFrom method beyond the options specified in SetSockOpt. The supported values of AFlags includes: