Class Interception
Interception processor that notifies clients about G/M/T-codes being processed
Inherited Members
Namespace: DuetControlServer.IPC.Processors
Assembly: DuetControlServer.dll
Syntax
public class Interception : Base
Constructors
Interception(Connection, ClientInitMessage)
Constructor of the interception processor
Declaration
public Interception(Connection conn, ClientInitMessage initMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| Connection | conn | Connection instance |
| ClientInitMessage | initMessage | Initialization message |
Fields
SupportedCommands
List of supported commands in this mode
Declaration
public static readonly Type[] SupportedCommands
Field Value
| Type | Description |
|---|---|
| System.Type[] |
Remarks
In addition to these commands, commands of the Command interpreter are supported while a code is being intercepted
Methods
GetCodeBeingIntercepted(Int32)
Get the code being intercepted from a given connection
Declaration
public static Code GetCodeBeingIntercepted(int connection)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | connection | Connection ID to look up |
Returns
| Type | Description |
|---|---|
| Code | Code being intercepted |
Intercept(Code, InterceptionMode)
Called by the Code class to intercept a code. This method goes through each connected interception channel and notifies the clients.
Declaration
public static Task<bool> Intercept(Code code, InterceptionMode type)
Parameters
| Type | Name | Description |
|---|---|---|
| Code | code | Code to intercept |
| InterceptionMode | type | Type of the interception |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | True if the code has been resolved |
Exceptions
| Type | Condition |
|---|---|
| System.OperationCanceledException | Code has been cancelled |
IsInterceptingConnection(Int32)
Checks if the given connection is currently intercepting a code
Declaration
public static bool IsInterceptingConnection(int connection)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | connection | Connection ID to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the connection is intercepting a code |
Process()
Waits for commands to be received and enqueues them in a concurrent queue so that a Code can decide when to cancel/resume/resolve the execution.
Declaration
public override Task Process()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Task that represents the lifecycle of the connection |