Topic Path: Symbol Reference > Classes > TIdUDPBase Class > TIdUDPBase Methods > ReceiveString Method > ReceiveString Method (string, integer, Integer)
TIdUDPBase.ReceiveString Method (string, integer, Integer)

Reads a datagram from a remote computer.

function ReceiveString(
    var VPeerIP: string; 
    var VPeerPort: integer; 
    const AMSec: Integer = IdTimeoutDefault
): string; overload;
Address of the remote computer.
Port number of the remote computer.
Timeout value for the read operation. Default value is IdTimeoutDefault. Return Value:
Data received from the remote computer. 

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

VPeerIP is updated in ReceiveString to reflect the IP address on the remote computer where the data originated. 

VPeerPort is updated in ReceiveString to reflect the port number on the remote computer where the data originated. 

AMSec indicates the number of milliseconds to delay while waiting for the socket handle in Binding to become Readable. The default value for AMSec is IdTimeoutDefault, and indicates that the value in ReceiveTimeOut will be used as the timeout value. Otherwise the numeric value in AMSec is used. 

ReceiveString allocates a buffer for the read operation that contains the number of bytes indicated in BufferSize. ReceiveString calls ReceiveBuffer to read the datagram into the buffer, and to update the values in VIP and VPort. 

The return value for the method is the string contents of the buffer from ReceiveBuffer.

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