Table of Contents

Class MaaAgentClient

Namespace
MaaFramework.Binding
Assembly
MaaFramework.Binding.Native.dll

A wrapper class providing a reference implementation for MaaFramework.Binding.Interop.Native.MaaAgentClient.

public class MaaAgentClient : MaaDisposableHandle<nint>, IMaaAgentClient<nint>, IMaaAgentClient, IMaaDisposableHandle<nint>, IMaaDisposable, IDisposable

Inheritance

Implements

Inherited Members

Constructors

MaaAgentClient(string)

Creates a MaaFramework.Binding.MaaAgentClient instance.

Properties

AgentServerProcess

Gets the agent server process managed by MaaFramework.Binding.IMaaAgentClient from method LinkStart.

Id

Gets the unique identifier used to communicate with the agent server.

IsAlive

Gets whether the connection is alive.

IsConnected

Gets whether the MaaFramework.Binding.IMaaAgentClient is connected to the agent server.

Resource

Methods

Cancel(Func<bool>?, Task<bool>?, MaaJob?)

Cancels the agent operation.

CancelWith(CancellationToken, Func<bool>?, Task<bool>?, MaaJob?)

Cancels the agent operation with a specified token.

Create(string, MaaResource)

Creates a MaaFramework.Binding.MaaAgentClient instance.

Create(MaaResource)

Creates a MaaFramework.Binding.MaaAgentClient instance.

Dispose(bool)

Releases all resources from MaaFramework.

LinkStart()

Starts the connection.

LinkStart(ProcessStartInfo, CancellationToken)

Starts the agent server process using the specified System.Diagnostics.ProcessStartInfo and connects to the agent server.

To start a new process, the current MaaFramework.Binding.IMaaAgentClient.AgentServerProcess must have exited first.

The agent server process will be killed when System.IDisposable.Dispose is called.

LinkStart(AgentServerStartupMethod, CancellationToken)

Starts the agent server process using the specified System.Diagnostics.ProcessStartInfo and connects to the agent server.

To start a new process, the current MaaFramework.Binding.IMaaAgentClient.AgentServerProcess must have exited first.

The agent server process will be killed when System.IDisposable.Dispose is called.

LinkStartUnlessProcessExit(Process, CancellationToken)

Starts the connection asynchronously unless the process has exited.

LinkStop()

Stops the connection.

ReleaseHandle()

When overridden in a derived class, executes the code required to free the handle.

SetTimeout(long)

Sets the timeout for the agent server to respond.

SetTimeout(TimeSpan)

Sets the timeout for the agent server to respond.