Indy 9
TIdServerIOHandler
Hierarchy, Properties, Methods, Events, Unit: IdServerIOHandler
Defines the framework for IOHandler support in a multi-threaded server.
TIdServerIOHandler = class(TIdComponent)
Unit
IdServerIOHandler
Description
TIdServerIOHandler is a TIdComponent descendant that specifies the framework used in a multi-threaded server to support the Indy IOHandler framework.

TIdServerIOHandler provides virtual methods, like Init and Accept, that allow initialization and realization of an IOHandler for a multi-threaded server that uses a listening thread to detect client connections. Both Init and Accept are empty implementations in TIdServerIOHandler, and must be overridden in descendant classes, like TIdServerIOHandlerSocket, that utilize a specific input/output source.


TIdServerIOHandler.Accept
TIdServerIOHandler
Realizes an IO handler for a threaded client connection.
function Accept(ASocket: TIdStackSocketHandle; AThread: TIdThread = nil): TIdIOHandler; virtual;
Parameters
ASocket: TIdStackSocketHandle
Handle for the listener thread detecting the client connection.
Return Value
TIdIOHandler - IO handler to use for the threaded client connection.
Description
Accept is a TIdIOHandler function that allows a multi-thread server to realize a TIdIOHandler instance using a specific input/output source for a threaded client connections.

Accept is called by the listener thread for the multi-thread server when a new threaded client connection is detected. Accept is used to create the TIdIOHandler using the socket handler for the listener thead. The return value is assigned to the TIdTCPConnection.IOHandler in the threaded client connection for subsequent input/output operations.

Accept is an empty implementation in TIdServerIOHandler that returns Nil. Descendant classes must override the method to crete IO handlers for newly accepted client connections that require a specific type of input/output source.


TIdServerIOHandler.Init
TIdServerIOHandler
Initializes the server IO handler for a multi-threaded server.
procedure Init; virtual;
Description
Init is a virtual procedure that allows initialization required for the server IOHandler. Init is an empty implementation in TIdServerIOHandler, and can be overridden in a descendant class to perform maintenance and housekeeping needed for a specific type of input/output source.

Use Accept to realize a TIdIOHandler instance for a specific input/output source used for a threaded client connections.

Init is used when a multi-threaded server becomes Active, but prior to allocating socket bindings for any listener threads or client connections.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.