Internet Direct (Indy)
Home
PreviousUpNext
TIdListenerThread Class

Listener thread for TCP Servers.

Pascal
TIdListenerThread = class(TIdThread);

TIdListenerThread is a TIdThread descendant that listens for client connections for a multi-threaded TCP-based server. One or more instances of TIdListenerThread are used in TIdTCPServer, and descendants classes, to detect new client connection requests and to spawn new executable tasks (or contexts) for each successful connection to the server. 

TIdListenerThread extends the ancestor class by implementing the BeforeRun, Run, and AfterRun methods, and the OnBeforeRun event handler property. 

TIdListenerThread instances are created using the Bindings allocated for a TIdTCPServer instance when the server becomes active. TIdListenerThread maintains a reference to the server that owns the listening thread to provide access to the properties and methods of the server from within the TIdListenerThread instance. TIdListenerThread also maintains a Binding used for socket operations for the listener thread. 

During execution of the listener thread, the Scheduler for the server is accessed to acquire the thread /fiber / yarn used for the new client connection to the server. The server is updated to reflect the context (both the connection and the thread / fiber of execution) for the new client connection accepted by the listening thread.

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.