Table of Contents

Class CommandConnection

Namespace
DuetAPIClient
Assembly
DuetAPIClient.dll

Connection class for sending commands to the control server

public sealed class CommandConnection : BaseCommandConnection, IDisposable
Inheritance
CommandConnection
Implements
Inherited Members

Constructors

CommandConnection()

Create a new connection in command mode

public CommandConnection()

Methods

Connect(string?)

Establish a connection to the given UNIX socket file

public void Connect(string? socketPath = null)

Parameters

socketPath string

Optional path to the DCS UNIX socket file

Exceptions

IncompatibleVersionException

API level is incompatible

IOException

Connection mode is unavailable

SocketException

Init message could not be processed

ConnectAsync(string?, CancellationToken)

Establish a connection to the given UNIX socket file

public Task ConnectAsync(string? socketPath = null, CancellationToken cancellationToken = default)

Parameters

socketPath string

Optional path to the DCS UNIX socket file

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

IncompatibleVersionException

API level is incompatible

IOException

Connection mode is unavailable

OperationCanceledException

Operation has been cancelled

SocketException

Init message could not be processed

See Also