TldlOHandler SocketConnect Client

Establisheds a remote connection for the input/output handler.

procedure ConnectClient(const AHost: string; const APort: Integer; const ABoundIP: string; const ABoundPort: Integer; const ABoundPortMin: Integer; const ABoundPortMax: Integer; const ATimeout: Integer = IdTimeoutDefault); override;

Parameters const AHost: string Address of the remote system for the client connection. const APort: Integer

Port number for the remote connection. const ABoundIP: string

IP Address bound to the local system. const ABoundPort: Integer

Port number bound to the local computer. const ABoundPortMin: Integer

Minimum bound port number for the local system. const ABoundPortMax: Integer

Maximum bound port number for the local system. const ATimeout: Integer = IdTimeoutDefault Number of milliseconds to wait before a connection attempt fails. Default value is IdTimeoutDefault [CI Description

ConnectClient is an overriden procedure in TldlOHandlerSocket [C] that implements the mechanism that allows an input/output handler to prepare and establish a client connection to a remote computer system using the input parameters.

ConnectClient calls the inherited ConnectClient method, allocates and Binds the socket [C] handle in Binding [C] using the values specified in ABoundIP, ABoundPort, ABoundPortMin, and ABoundPortMax.

If the value in AHost is a host name instead of an IP address, ConnectClient will trigger the OnStatus event to indicate that the address will be resolved prior to setting the peer address and port number for the physical connection in Binding [C].

ConnectClient will also set the socket [C] options required for UseNage support.

ConnectClient also triggers the OnStatus event handler to indicate that the connection will be opened to the peer client connection prior to trying to open the connection with the timeout value specified in ATimeout.

ConnectClient uses a thread to connect [C] to the remote computer system to allow use of a timeout value in Connect while respecting the operation of the TldAntifreeze component when present. If the connection thread is terminated with an exception message, ConnectClient can raise an EldConnectException [C] exception with the exception messasge from the threaded connection. If the connection thread is terminated without an exception message prior to being Connected [C], ConnectClient can raise an EldConnectTimeout [C] exception.

Use Connected [C] to detemine if the physical connection has been established after a call to ConnectClient. See Also

TldlOHandlerSocket.Open [C], TldlOHandlerSocket.Connected [C], TldlOHandlerSocket [C], TldSSLIOHandlerSocket [C]

+1 0

Post a comment