System.Tether.Manager.TTetheringProfile.GetConnectionTo
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 |
---|---|---|
No available connections to <remote profile> |
| |
You need to add a protocol and an adapter connecting to <remote profile> |
| |
Can't get a connection to profile <remote profile> |
| |
Can't connect to profile <remote profile> |
|