Indy 9
|
TIdServerIOHandler = class(TIdComponent)
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.
function Accept(ASocket: TIdStackSocketHandle; AThread: TIdThread = nil): TIdIOHandler; virtual;
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.
procedure Init; virtual;
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.