AdsClient.ConnectAndWaitAsync Method
Connects to the target address and waits until the AdsClient is disconnected asynchronously.
Namespace: TwinCAT.Ads
Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)
Version: 6.0.328+39e3229
Syntax
C#
public Task ConnectAndWaitAsync(
AmsAddress address,
CancellationToken cancel
)
Parameters
address |
Type: TwinCAT.Ads.AmsAddress |
cancel |
Type: System.Threading.CancellationToken |
Return Value
Type: Task
Returns a task object that represents the ConnectAndWaitAsync(AmsAddress,
CancellationToken) operation as result.
Remarks
This method is used for scenarios, where the AdsClient disconnects from other code asynchronously. When this method returns, the connection is already terminated and only additional cleanup code should be processed.