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
socketPathstringOptional 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
socketPathstringOptional path to the DCS UNIX socket file
cancellationTokenCancellationTokenOptional 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