Indy 9
|
TIdListenerThread = class(TIdThread)
TIdListenerThread maintains a reference to the server that owns the listening thread, and a list of socket handles that have been accepted by the server. TIdListenerThread also provides a general mechanism to encapsulate the time that the listening thread should wait to accept new socket connection requests.
TIdListenerThread differs from a typical TThread by extending the Execute method to allow access to BeforeRun, Run, and AfterRun methods. In addition, Start and Stop methods are provide allow finer control of thread initialization, resumption, and immediate termination.
property Binding: TIdSocketHandle;
Binding is initialized in the Create constructor, and contains a socket descriptor allocated for listener threads on the server when it becomes active.
property Server: TIdTCPServer;
constructor Create(AServer: TIdTCPServer; ABinding: TIdSocketHandle); reintroduce;
Create initializes the TList used to store socket handles allocated by the server. Create also sets the Server property to the oner of the listener thread as identified by the parameter axServer.