Method LinkStartUnlessProcessExit
- Namespace
- MaaFramework.Binding
- Assembly
- MaaFramework.Binding.Native.dll
LinkStartUnlessProcessExit(Process, CancellationToken)
Starts the connection asynchronously unless the process has exited.
public Task<bool> LinkStartUnlessProcessExit(Process process, CancellationToken cancellationToken = default)
Parameters
process
Process-
The process to monitor for exit status.
cancellationToken
CancellationToken-
An optional token to cancel the asynchronous operation waiting for the connection.
Returns
- Task<bool>
-
A task that represents the asynchronous operation. The task result contains true if the connection was started successfully; otherwise, false.
Remarks
Wrapper of MaaFramework.Binding.Interop.Native.MaaAgentClient.MaaAgentClientConnect(System.IntPtr).
Exceptions
- OperationCanceledException
-
The
cancellationToken
has had cancellation requested.