Internet Direct (Indy) Version 9.0.1 Beta
TIdUDPBase.ReceiveString
Reads data from the remote computer.

function ReceiveString(const AMSec: Integer): string; overload;
function ReceiveString(var VPeerIP: string; var VPeerPort: integer; const AMSec: Integer): string; overload;
Parameters
var VPeerIP: string
Address of the remote computer.

var VPeerPort: integer
Port number of the remote computer.

const AMSec: Integer = IdTimeoutDefault
Timeout value for the read operation. Default value is IdTimeoutDefault.

Returns
String - Data received from the remote computer.

Description
ReceiveString is a String function used to receive data from a remote computer system.

VPeerIP is updated to reflect the IP address on the remote computer where the data originated. VPeerPort is updated to reflect the port number on the remote computer where the data originated.

If AMSec is omitted, the default timeout value used is ReceiveTimeout. Use TIdTimeoutInfinite to disable read timeout. If a timeout occurs while waiting for the socket Binding to become readable, VPeerIP is set to '' and VPeerPort is set to 0 before exiting from the method.

ReceiveString will read up to BufferSize bytes from the remote computer.

ReceiveString will raise an EIdException exception if the number of bytes read from the remote computer is 0.