Internet Direct (Indy) Version 9.0.1 Beta
TIdTCPClient.Connect
Opens the connection for the client.

procedure Connect(const ATimeout: Integer); virtual;
Description
Connect is a procedure that attempts to open the client connection to a server. Connect requires a host name (address) in Host and the port number in Port to establish a connection. Many protocol implementations override this method to provide special initialization sequences required by the protocol.

A client connection will be established using the IOHandler for the connection with BoundIP and BoundPort as the local IP address and port number for the client. An EIdAlreadyConnected exception will be raised if the IOHandler has already established a connection for the client. The IOHandler is used to default local port number assignment when BoundPort contains the value BoundPortDefault. The IOHandler also uses SocksInfo and the timeout value in ATimeout when opening the connection.

If an exception is raised in the method, Connect calls DisconnectSocket prior to re-raising the exception.