Table of Contents

Class Server

Namespace
DuetControlServer.IPC
Assembly
DuetControlServer.dll

Class that holds main functionality for inter-process communication

[DiagnosticsPriority(-2)]
public sealed class Server : BackgroundService, IHostedService, IDisposable, IDiagnostics
Inheritance
Server
Implements
Inherited Members

Constructors

Server(CommandFactory, ProcessorFactory, LockManager, ObjectModel, IHostApplicationLifetime, ILogger<Server>, IOptions<Settings>)

Class that holds main functionality for inter-process communication

public Server(CommandFactory commandFactory, ProcessorFactory processorFactory, LockManager lockManager, ObjectModel model, IHostApplicationLifetime lifetime, ILogger<Server> logger, IOptions<Settings> settings)

Parameters

commandFactory CommandFactory

Factory to create commands

processorFactory ProcessorFactory

Factory to create connection processors

lockManager LockManager

Lock manager to handle read/write locks

model ObjectModel

Object model

lifetime IHostApplicationLifetime

Host application lifetime

logger ILogger<Server>

Logger instance

settings IOptions<Settings>

Settings

Fields

MinimumProtocolVersion

Minimum supported protocol version number

public const int MinimumProtocolVersion = 7

Field Value

int
See Also

Methods

ExecuteAsync(CancellationToken)

Process incoming connections

protected override Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Returns

Task

Asynchronous task

PrintDiagnostics(StringBuilder)

Print diagnostics

public void PrintDiagnostics(StringBuilder builder)

Parameters

builder StringBuilder

String builder to write to

StartAsync(CancellationToken)

Initialize the IPC subsystem and start listening for connections

public override Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

StopAsync(CancellationToken)

Stop the IPC server and close the UNIX socket

public override Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token

Returns

Task