Indy 9
|
TIdEchoUDP = class(TIdUDPClient)
TIdEcho is a TIdUDPClient descendant that is a useful debugging and measurement protocol where the data sent to the server is simply sent back to the originating client. TIdEchoUDP is provided as a measure of the time it takes to send and receive data from an Echo Server (TIdEchoUDPServer).
The UDP-based implementation of the Echo Protocol is a connection-less facility. An Echo Server listens for data arriving on Port 7. When an echo request is received, any data is returned to the originating client.
To use TIdEchoUDP, perform the following actions in your application:
property EchoTime: Cardinal;
EchoTime is calculated using GetTickDiff, from IdGlobal.pas, and represents the elapsed milliseconds from the start of the echo request until completion of the echo response. EchoTime is adjusted to reflect situations where GetTickCount reverts to a 0 (zero) value after the Echo transmission has been started.
property Port: Integer;
constructor Create(AOwner: TComponent); override;
An application must initialize Host prior to sending data using the Echo method.
function Echo(AText: String): String;
Echo monitors the time needed to send the echo request and receive the echo response, and stores the elapsed time in EchoTime. Echo uses GetTickDiff, from IdGlobal.pas, to retrieve both the starting and ending milliseconds measurements used to determine EchoTime. Echo can account for TickCount reverting to a 0 (zero) value after starting the Echo transmission.