Internet Direct (Indy) Version 9.0.2 Beta
|
procedure ConnectClient(const AHost: string; const APort: Integer; const ABoundIP: string; const ABoundPort: Integer; const ABoundPortMin: Integer; const ABoundPortMax: Integer; const ATimeout: Integer); override;
ConnectClient calls the inherited ConnectClient method, allocates and Binds the socket handle in Binding 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.
ConnectClient will also set the socket 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 to the remote computer system to allow use of a timeout value in Connect while respecting the operation of the TIdAntifreeze component when present. If the connection thread is terminated with an exception message, ConnectClient can raise an EIdConnectException exception with the exception messasge from the threaded connection. If the connection thread is terminated without an exception message prior to being Connected, ConnectClient can raise an EIdConnectTimeout exception.
Use Connected to detemine if the physical connection has been established after a call to ConnectClient.