Internet Direct (Indy)
Home
PreviousUpNext
TIdStackDotNet.Connect Method

Establishes a connection for the socket handle.

Pascal
procedure Connect(
    const ASocket: TIdStackSocketHandle; 
    const AIP: string; 
    const APort: TIdPort; 
    const AIPVersion: TIdIPVersion = ID_DEFAULT_IP_VERSION
); override;
Parameters 
Description 
ASocket 
Socket handle for the connection.
 
AIP 
IP address for the remote network connection.
 
APort 
Port number for the remote network connection.
 
AIPVersion 
IP address family for the IP address. 

Connect is an overridden procedure that specifies the method used to access the Connect() API for the protocol stack implementation. 

Connect creates a connection to the remote destination specified in AIP and APort using an IPEndPoint. 

For stream sockets, an active connection is opened to the remote network using AIP and APort as the destination. For datagram sockets, AIP and APort are used to establish a default destination address but no connection is opened. 

On successfully completion of Connect, the socket handle is ready for sending and receiving data. 

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

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.