Topic Path: Symbol Reference > Classes > TIdSocketHandle Class > TIdSocketHandle Methods > Accept Method
ContentsIndexHome
PreviousUpNext
TIdSocketHandle.Accept Method

Accepts a connection for a listener socket.

function Accept(
    ASocket: TIdStackSocketHandle
): Boolean;
Parameters 
Description 
ASocket 
Socket descriptor with the new connection request. 

Boolean - True when a valid sockt handle exists and has been bound for the new connection request.

Accept is a Boolean function that handles a pending connection request for the listener socket descriptor. 

Accept calls Reset to initialize the IP addresses and port numbers for both the local and remote systems for the connection. Accept uses GStack to allow the protocol stack to accept the new connection request, and to allocate the socket handle for the new connection. 

If the socket handle is valid for the new connection, Accept calls UpdateBindingLocal to update the IP and port number for the local connection. UpdateBindingLocal is necessary as there may be multiple listening IP addresses and port number in use on the listener. 

If the socket handle is valid for the new connection, Accept calls UpdateBindingPeer to retrieve the IP and port number for the remote connection. 

Accept is used in the listening thread of server applications that spawn new threads for each connection request, like TIdListenerThread and TIdUDPListenerThread.

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