Class Base
Base class for connection interpreters
Inherited Members
Namespace: DuetControlServer.IPC.Processors
Assembly: DuetControlServer.dll
Syntax
public class Base
Constructors
Base(Connection)
Base constructor for connection interpreters. Invoke this from any derived class
Declaration
public Base(Connection conn)
Parameters
Type | Name | Description |
---|---|---|
Connection | conn | Connection instance |
Properties
Connection
Connection to the IPC client served by this processor
Declaration
protected Connection Connection { get; }
Property Value
Type | Description |
---|---|
Connection |
Methods
AddSupportedCommands(IEnumerable<Type>)
Add a list of supported commands
Declaration
protected static void AddSupportedCommands(IEnumerable<Type> supportedCommands)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Type> | supportedCommands | List of supported commands |
GetCommandType(string)
Get the corresponding command type
Declaration
public static Type? GetCommandType(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the command |
Returns
Type | Description |
---|---|
Type | Command type or null if not found |
Process()
Worker method for a given connection. No CancellationToken is passed here, use CancellationToken instead. Once this task exits the connection is terminated.
Declaration
public virtual Task Process()
Returns
Type | Description |
---|---|
Task | Task that represents the worker lifecycle |
Exceptions
Type | Condition |
---|---|
NotImplementedException | Thrown if this method is not overridden |