Dart SecureTcp, SecureServer Controls
Connect Method
Specifies either a hostname or IP address.
Specifies a remote port between 1 and 65535, inclusive. Defaults to 443.
Specifies the local network interface (either a hostname or IP address).
Specifies the local port. Defaults to the ephemeral port, 0.
Description
Establish a secure connection. The State property immediately changes to tcpConnecting and changes to tcpConnected when the connection is established, the security protocol is negotiated and authentication succeeds. The State property can be checked in the body of the State Event, polled off a timer, or checked immediately after this method is used when a positive Timeout is specified.
Syntax
Visual Basic
Public Sub Connect( _
   ByVal RemoteName As String, _
   Optional ByVal RemotePort As Long = 443, _
   Optional ByVal LocalName As String, _
   Optional ByVal LocalPort As Long = 0 _
) 
Parameters
RemoteName
Specifies either a hostname or IP address.
RemotePort
Specifies a remote port between 1 and 65535, inclusive. Defaults to 443.
LocalName
Specifies the local network interface (either a hostname or IP address).
LocalPort
Specifies the local port. Defaults to the ephemeral port, 0.
Remarks

This method initiates a connection and a secure negotiation with a secure server. This method blocks if Timeout is greater than 0. The Blocked Property may be checked to verify the control is not executing another method.

If Protocol specifies a security protocol and the server does not support that protocol, then the Error event fires (and an error will be returned if Timeout is greater than 0) with Number=ptProtocol and Description="Security protocol negotiation failed." The State event fires twice as the State changes to ptClosing and ptClosed, respectively.

If the server requests authentication and the Certificate property does not reference a valid certificate (by the time the Certificate Event returns) then the Error event fires (and an error will be returned if Timeout is greater than 0) with Number=ptNoCertificate and Description="There was an error in creating credentials." Typically this means the digital certificate referenced by the Certificate property could not be found. If the server closes the connection the State event fires twice as the State changes to ptClosing and ptClosed, respectively.

If the server does not authenticate then the Error event fires (and an error will be returned if Timeout is greater than 0) with Number= ptAuthentication and Description="The server could not be authenticated." The State event fires twice as the State changes to ptClosing and ptClosed, respectively.

Error Codes

This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):

See Also

SecureTcp Object  | SecureTcp Members


PowerTCP SSL for ActiveX Documentation Version 2.2.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic