Topic Path: Symbol Reference > Classes > TIdServerIOHandler Class > TIdServerIOHandler Methods > Accept Method
TIdServerIOHandler.Accept Method

Specifies the IOHandler framework for a thread or fiber connections to a server.

function Accept(
    ASocket: TIdSocketHandle; 
    AListenerThread: TIdThread; 
    AYarn: TIdYarn
): TIdIOHandler; virtual;
Socket descriptor representing the client connection for the IOHandler.
Server Listener thread that has detected the connection request.
Scheduler for the thread/fiber. 

TIdIOHandler - THe IOHandler created for the client connection to the server.

Accept is a virtual TIdIOHandler function used to create a TIdIOHandler instance for threaded client connections to a server. 

ASocket is the socket descriptor representing the client connection for the IOHandler. 

AListenerThread is the Listener thread in the server that has detected the client connection request. 

AYarn is the scheduler for the threaded or fiber-based client connection. 

Accept is called during execution of the listener thread in a multi-thread server when a new threaded client connection is detected. Accept is used to create the managed TIdIOHandler used to read and write to the client connection during execution of the threaded client. 

Accept can return Nil when the connection cannot be accepted or the listenter thread has been stopped. 

Accept always returns Nil in TIdServerIOHandler, and must be reimplemented in a descendant class (like TIdServerIOHandlerSocket) that provides access to the protocol stack for the platform hosting the Indy library.

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