Internet Direct (Indy) Version 9.0.1 Beta
TIdSocketHandle.Connect
Establish a connection to a peer.

function Connect(const AFamily: Integer): Integer; virtual;
Parameters
const AFamily: Integer = Id_PF_INET
Internet protocol family. Default is Id_PF_INET.

Returns
Integer - 0 on success.

Description
Connect is an Integer function that opens a connection to a remote system using the specified Internet protocol family.

Connect uses IP and Port, and the parameter AFamily, to call the Connect facilities of the protocol stack. When Connect has successfully completed, the socket will be ready to send and receive data using Send, SendTo, Recv, and RecvFrom.

Use Readable, any time following a successful Connect, to determine if the socket is in a valid input/output state.