Method LinkStartUnlessProcessExit
- Namespace
- MaaFramework.Binding
- Assembly
- MaaFramework.Binding.dll
LinkStartUnlessProcessExit(Process, CancellationToken)
Starts the connection asynchronously unless the process has exited.
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.
Exceptions
- OperationCanceledException
-
The
cancellationToken
has had cancellation requested.