System.Tether.Manager.TTetheringProfile.GetConnectionTo

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetConnectionTo(const AProfile: TTetheringProfileInfo; const AProtocolType: TTetheringProtocolType = '';  const AnAdapterType: TTetheringAdapterType = ''; Connect: Boolean = True): TTetheringConnection; virtual;

C++

virtual TTetheringConnection* __fastcall GetConnectionTo(const TTetheringProfileInfo &AProfile, const System::UnicodeString AProtocolType = System::UnicodeString(), const System::UnicodeString AnAdapterType = System::UnicodeString(), bool Connect = true);

Properties

Type Visibility Source Unit Parent
function protected
System.Tether.Manager.pas
System.Tether.Manager.hpp
System.Tether.Manager TTetheringProfile

Description

Returns a connection that provides access to the specified remote profile.

Use AProtocolType and AnAdapterType to determine the type of protocol and adapter of the resulting connection. These two parameters must be used together; if you provide a non-empty value for one of them, you must provide a non-empty value for the other as well.

Use Connect to determine whether you want GetConnectionTo to ensure that the protocol of the returned connection is connected (True) or not (False).

Exceptions

GetConnectionTo may raise the following exceptions:

Exception Message Scenarios

ETetheringException

No available connections to <remote profile>

  • There are no available connections for AProfile.
  • Your profile does not support the specified combination of AProtocolType and AnAdapterType.
  • There are no available connections for AProfile with the specified combination of AProtocolType and AnAdapterType.

You need to add a protocol and an adapter connecting to <remote profile>

  • You specified a non-empty value for AProtocolType or AnAdapterType, but not for both.

Can't get a connection to profile <remote profile>

  • The CreateInstance method of the protocol selected to establish a connection raised an exception.
  • The StartCommunication method of the protocol selected to establish a connection raised an exception.

Can't connect to profile <remote profile>

  • You requested an established connection (Connect is True) but connecting the protocol of the new connection failed.

See Also