Internet Direct (Indy) Version 9.0.2 Beta
TIdTCPServer
Implements a multi-threaded TCP Server.

TIdTCPServer = class(TIdComponent)
Description
TIdTCPServer encapsulates a complete, multi-threaded TCP (Transmission Control Protocol) server. TIdTCPServer uses one or more threads to listen for client connections, and in conjunction with a TIdThreadMgr, allocates a separate thread to handle each client connection to the server. A list of active ThreadClass instances are maintained in Threads.

TIdTCPServer provides options that allow configuration of the server listener threads, including:

TIdTCPServer also provides properties and methods to control protocol specific options, including:

The TIdTCPServer architecture also implements two mechanisms for servicing peer connections. The first method uses event handlers that execute in the context of the threaded peer connection. The server implementation can assign procedures to the event handlers to respond to the following events:

The other method uses a collection of TIdCommandHandler objects to recognizing valid server commands, and provides methods and properties needed to handle parameters, perform actions, and formulate error and success responses. The properties and method realted to CommandHandler usgae include the following:

Server implementors can choose between using server-based event handlers and command handlers to provide finer control over the operation of the server and protocol.

TIdTCPServer can be used as a base class to create custom TCP server descendants that support specific protocols. Many of the Indy server components, such as TIdChargenServer, TIdDayTimeServer, TIdDICTServer, TIdEchoServer, TIdFingerServer, TIdGopherServer, TIdHostNameServer, TIdHTTPServer, TIdIRCServer, TIdNNTPServer, TIdQUOTDServer, TIdTelnetServer, and TIdWhoisServer, are descendants of the TIdTCPServer component.