Internet Direct (Indy)
Home
PreviousUpNext
TIdUDPBase.ReceiveString Method (string, integer, Integer)

Reads a datagram from a remote computer.

Pascal
function ReceiveString(
    var VPeerIP: string; 
    var VPeerPort: integer; 
    const AMSec: Integer = IdTimeoutDefault
): string; overload;
Parameters 
Description 
VPeerIP 
Address of the remote computer.
 
VPeerPort 
Port number of the remote computer.
 
AMSec 
Timeout value for the read operation. Default value is IdTimeoutDefault. Return Value:
 
String 
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.

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.