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

Accepts a connection request using the socket handle.

function Accept(
    ASocket: TIdStackSocketHandle; 
    var VIP: string; 
    var VPort: Integer; 
    const AIPVersion: TIdIPVersion = ID_DEFAULT_IP_VERSION
): TIdStackSocketHandle; override;
Socket handle to use for accept a new request.
IP address for the remote network on the accepted connection.
Port number for the remote network on the accepted connection.
IP address family for the IP address. 

TIdStackSocketHandle - Socket handle for the accepted connection.

Accept is an overridden TIdStackSocketHandle function that implements the method used to access the Accept() API for a protocol stack implementation. 

Accept is used to extract the first pending connection request on the queue of pending connections for the socket handle in ASocket. 

The return value for the method is the newly created socket handle that will handle the reads and writes for the requested connection. 

VIP and VPort are updated in Accept to reflect the IP address and port number for the remote network connection. Accept calls TranslateTInAddrToString to convert the native IP address to a string value for VIP, and NToHs to convert the byte order for the port number in VPort.

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