Table of Contents

Class DicomServer<T>

Namespace
FellowOakDicom.Network
Assembly
fo-dicom.core.dll

Representation of a DICOM server.

public class DicomServer<T> : IDicomServer<T>, IDicomServer, IDisposable where T : DicomService, IDicomServiceProvider

Type Parameters

T

DICOM service that the server should manage.

Inheritance
DicomServer<T>
Implements
Inherited Members
Extension Methods

Constructors

DicomServer(DicomServerDependencies)

Initializes an instance of the DicomServer<T> class.

public DicomServer(DicomServerDependencies dependencies)

Parameters

dependencies DicomServerDependencies

Properties

Exception

Gets the exception that was thrown if the server failed to listen.

public Exception Exception { get; protected set; }

Property Value

Exception

IPAddress

Gets the IP address(es) the server listens to.

public virtual string IPAddress { get; protected set; }

Property Value

string

IsListening

Gets a value indicating whether the server is actively listening for client connections.

public bool IsListening { get; protected set; }

Property Value

bool

Logger

Gets the logger used by DicomServer<T>

public ILogger Logger { get; set; }

Property Value

ILogger

Options

Gets the options to control behavior of DicomService base class. Gets the port to which the server is listening.

public DicomServiceOptions Options { get; }

Property Value

DicomServiceOptions

Port

Gets the port to which the server is listening.

public virtual int Port { get; protected set; }

Property Value

int

Registration

Gets the DICOM server registration ticket with the central registry. The registry prevents multiple DICOM servers from being created for the same IP address and port. This registration must be disposed alongside the DICOM server itself.

public DicomServerRegistration Registration { get; set; }

Property Value

DicomServerRegistration

ServiceScope

Gets the service scope that will live as long as the DICOM server lives. Must be disposed alongside the DicomServer instance.

public IServiceScope ServiceScope { get; set; }

Property Value

IServiceScope

Methods

CreateScp(INetworkStream)

Create an instance of the DICOM service class.

protected virtual T CreateScp(INetworkStream stream)

Parameters

stream INetworkStream

Network stream.

Returns

T

An instance of the DICOM service class.

Dispose()

public void Dispose()

Dispose(bool)

Execute the disposal.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

True if called from Dispose(), false otherwise.

StartAsync(string, int, ITlsAcceptor, Encoding, DicomServiceOptions, object, DicomServerOptions)

Starts the DICOM server listening for connections on the specified IP address(es) and port.

public virtual Task StartAsync(string ipAddress, int port, ITlsAcceptor tlsAcceptor, Encoding fallbackEncoding, DicomServiceOptions serviceOptions, object userState, DicomServerOptions serverOptions)

Parameters

ipAddress string

IP address(es) for the server to listen to.

port int

Port to which the server should be listening.

tlsAcceptor ITlsAcceptor

Handler to accept secure connections.

fallbackEncoding Encoding

Encoding to apply if no encoding is identified.

serviceOptions DicomServiceOptions

Service options

userState object

User state to be shared with the connected services.

serverOptions DicomServerOptions

Server options

Returns

Task

Awaitable Task.

Stop()

Stop server from further listening.

public virtual void Stop()