Topic Path: Symbol Reference > Classes > TIdStackDotNet Class > TIdStackDotNet Methods > Connect Method
TIdStackDotNet.Connect Method

Establishes a connection for the socket handle.

procedure Connect(
    const ASocket: TIdStackSocketHandle; 
    const AIP: string; 
    const APort: TIdPort; 
    const AIPVersion: TIdIPVersion = ID_DEFAULT_IP_VERSION
); override;
Socket handle for the connection.
IP address for the remote network connection.
Port number for the remote network connection.
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.

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