Topic Path: Symbol Reference > Classes > TIdStack Class > TIdStack Methods > Listen Method
TIdStack.Listen Method

Listens for remote connection requests.

procedure Listen(
    ASocket: TIdStackSocketHandle; 
    ABackLog: Integer
); virtual; abstract;
SOcket handle for the operation.
Unhandled connection requests allowed for the socket handle. 

Listen is an abstract virtual procedure that specifies the method used to access the Listen() API for a protocol stack implementation. 

Listen allows the socket handle in ASocket to begin listening for connection requests. ASocket is the socket handle to use for listening. Listen is generally used in servers that can have multiple incoming connection requests. 

ABacklog indicates the number of pending connection requests allowed for ASocket. 

Listen can be called than once on the same socket handle. This has the effect of updating the current backlog for the listening socket to the most recent value. If there are more pending connections than the new backlog value, the excess pending connections will be dropped. 

Use Accept to accept a pending connection request with a new socket handle for the connection.

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