Internet Direct (Indy)
Home
PreviousUpNext
TIdStackDotNet.NewSocketHandle Method

Creates a new socket handle that is bound to specific socket type and protocol.

Pascal
function NewSocketHandle(
    const ASocketType: TIdSocketType; 
    const AProtocol: TIdSocketProtocol; 
    const AIPVersion: TIdIPVersion = ID_DEFAULT_IP_VERSION; 
    const AOverlapped: Boolean = False
): TIdStackSocketHandle; override;
Parameters 
Description 
ASocketType 
Socket type (stream or datagram).
 
AProtocol 
Protocol to use for the socket handle.
 
AIPVersion 
IP address family for the IP address.
 
AOverlapped 
Indicates overlapped IO is permitted on the socket handle. 

TIdStackSocketHandle - Socket handle created with the specified attributes,

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

ASocketType indicates the TIdSocketType value to use as the socket type for the newly created socket handle. 

AProtocol indicates the TIdSocketProtocol value to use as the protocol for the newly created socket handle. 

AOverlapped indicates that overlapped IO operations are permitted on the socket handle. 

Exceptions occuring in the method are re-raised using either the EIdSocketError or EIdWrapperException exception types. 

For stream sockets, call Connect before reading or writing with the socket handle. Call Disconnect to close the connection on the socket handle. 

For datagram sockets, use SendTo or ReceiveFrom to send or receive datagrams. If Connect is called for a datagram socket, use Send and Receive to send or receive datagrams.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.