Topic Path: Symbol Reference > Classes > TIdECHOServer Class
ContentsIndexHome
PreviousUpNext
TIdECHOServer Class

Implements a TCP-based Echo server.

File
TIdECHOServer = class(TIdCustomTCPServer);

TIdECHOServer is a TIdTCPServer descendant that implements the TCP-based variant of the Echo Protocol, as described in the Internet Standards document: 

RFC 862 - Echo Protocol  

TIdEchoServer is useful as a debugging and measurement protocol where the data sent to the server is simply sent back to the originating client. The ECHO protocol provides a measure of the time it takes to send and receive data from an Echo Server (TIdECHOServer). 

The TCP-based implementation of the Echo Protocol server is a connection based application. An Echo Server listens for TCP connections on TCP Port 7. 

When a connection is established, any data received by the server is returned to the originating client. The connection remains open until the client application closes the connection. 

Set the value in DefaultPort to indicate the port assigned for listener threads in the server. 

Definitions for socket handles can be added to Bindings, and used to created one or more listener threads when the Active propert y in the server is set to True. 

TIdECHOServer overrides the protected method that controls execution of the tasks for client connections to implement the limited functionality of the ECHO protocol. As a result, the general-purpose OnExecute event handler is unused in TIdECHOServer. Any procedure assigned to the OnExecute event handler will be ignored. 

When new connections are accepted by the listener thread(s) in the server, the client context is executed. Data read from the connection is echoed back to the originating IP address and port number. Execution of the client context repeates until the connection for the client context is closed.

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