Topic Path: Symbol Reference > Classes > TIdCustomTCPServer Class > TIdCustomTCPServer Properties > Contexts Property
TIdCustomTCPServer.Contexts Property

Executable tasks for client connections to the server.

property Contexts: TIdThreadList;

Contexts is a read-only TIdThreadList property that represents the list containing TIdContext instances for client connections to the server. TIdContexts instances are created and stored in Contexts when the new executable task for the client connection is created in a listener thread. 

ContextClass provides the class reference used to create new TIdContexts instances . 

The context provides the client connection and IOHandler for the accepted connection request, the list of Contexts for the server, and the thread or fiber (Yarn) acquired from the Scheduler for controlling execution the task for the client connection. 

The TIdContext instance uses protected procedures from the server in its OnBeforeRun, OnRun, and OnAfterRun event handlers. The Scheduler is used to start execution of the task using the Yarn (thread or fiber) acquired for the TIdContext

Contexts is also used during ShutDown for the server (setting Active to False). Contexts is used to access and terminate all executing tasks for client connections to the server. 

Resources for the Contexts property are allocated during initialization of the component at runtime, and freed in Destroy.

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