Topic Path: Symbol Reference > Classes > TIdSocketHandle Class > TIdSocketHandle Methods > AllocateSocket Method
TIdSocketHandle.AllocateSocket Method

Creates a socket descriptor with the specified socket and protocol families.

procedure AllocateSocket(
    const ASocketType: TIdSocketType = Id_SOCK_STREAM; 
    const AProtocol: TIdSocketProtocol = Id_IPPROTO_IP
Socket family. Default is Id_SOCK_STREAM.
Protocol family. Default is Id_IPPROTO_IP

AllocateSocket is a procedure used to creates a socket descriptor with the socket family and protocol family as indicated in ASocketType and AProtocol. 

ASocketType determines address family used for the connection, and indicates the valid protocol family options for the socket type. The following socket types are supported: 



AProtocol identifies the Internet protocol to be used for the given socket type. Only a single protocol exists to support a particular socket type using a given address format. The following protocol families are supported: 



The value in the Overlapped property indicates if overlapped IO operations are permitted for the socket descriptor. 

AllocateSocket calls CloseSocket to ensure that any previously allocated socket handle is disconnected and reset

AllocateSocket sets the Handle for the socket descriptor to the value created on the global protocol stack (GStack) using the values indicated in ASocketType, AProtocol, and OverLapped.

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