Indy 9
|
TIdServerIOHandlerSocket = class(TIdServerIOHandler)
TIdServerIOHandler provides implementations of the Init and Accept methods that allow initialization and realization of a socket-based IOHandler for a multi-threaded server that uses a listening thread to detect client connections.
function Accept(ASocket: TIdStackSocketHandle; AThread: TIdThread = nil): TIdIOHandler; override;
Accept creates and opens a TIdIOHandlerSocket instance that is used to accept the bind the socket handle provided in ASocket to a client connection.
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.
procedure Init; override;
Use Accept to realize a TIdIOHandler instance for a socket-based 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.