Internet Direct (Indy)
Home
PreviousUpNext
TIdEcho.Echo Method

Sends and receives echo data.

Pascal
function Echo(
    AText: String
): String;
Parameters 
Description 
AText 
Data to send to the echo server. 

String - Data received from the echo server.

Echo is a String function that sends the text in AText to the echo server, and returns the text received from the echo server. If the returned value is not the same as the text in AText, there may be a problem with the server or the TCP connection. 

Echo monitors the time needed to send the echo request and receive the echo response, and stores the elapsed time in EchoTime

Echo uses GetTickCount to retrieve both the starting and ending times (in milliseconds) used to determine EchoTime. EchoTime is the difference between the starting and ending tick counts, and accounts for the ending time reverting to a 0 (zero) value after starting the Echo transmission. 

Echo triggers the OnWorkBegin and OnWorkEnd event handlers both prior to and following the act of writing the value in AText using the IOHandler for the connection. 

Echo also triggers the OnWorkBegin and OnWorkEnd event handlers both prior to and following the act of reading the echo response using the internal buffering mechanism for the IOHandler

Assign values to the Host and Port properties and call Connect to open the connection and IOHandler for the client.

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.