Class DicomServer<T>
Representation of a DICOM server.
Inheritance
Inherited Members
Namespace: FellowOakDicom.Network
Assembly: fo-dicom.core.dll
Syntax
public class DicomServer<T> : IDicomServer<T>, IDicomServer, IDisposable where T : DicomService, IDicomServiceProvider
Type Parameters
Name | Description |
---|---|
T | DICOM service that the server should manage. |
Constructors
DicomServer(DicomServerDependencies)
Initializes an instance of the DicomServer<T> class.
Declaration
public DicomServer(DicomServerDependencies dependencies)
Parameters
Type | Name | Description |
---|---|---|
DicomServerDependencies | dependencies |
Properties
Exception
Gets the exception that was thrown if the server failed to listen.
Declaration
public Exception Exception { get; protected set; }
Property Value
Type | Description |
---|---|
System.Exception |
IPAddress
Gets the IP address(es) the server listens to.
Declaration
public virtual string IPAddress { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
IsListening
Gets a value indicating whether the server is actively listening for client connections.
Declaration
public bool IsListening { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Logger
Gets the logger used by DicomServer<T>
Declaration
public ILogger Logger { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Extensions.Logging.ILogger |
Options
Declaration
public DicomServiceOptions Options { get; }
Property Value
Type | Description |
---|---|
DicomServiceOptions |
Port
Gets the port to which the server is listening.
Declaration
public virtual int Port { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
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.
Declaration
public DicomServerRegistration Registration { get; set; }
Property Value
Type | Description |
---|---|
DicomServerRegistration |
ServiceScope
Gets the service scope that will live as long as the DICOM server lives. Must be disposed alongside the DicomServer instance.
Declaration
public IServiceScope ServiceScope { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IServiceScope |
Methods
CreateScp(INetworkStream)
Create an instance of the DICOM service class.
Declaration
protected virtual T CreateScp(INetworkStream stream)
Parameters
Type | Name | Description |
---|---|---|
INetworkStream | stream | Network stream. |
Returns
Type | Description |
---|---|
T | An instance of the DICOM service class. |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Execute the disposal.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | True if called from Dispose(), false otherwise. |
StartAsync(String, Int32, ITlsAcceptor, Encoding, DicomServiceOptions, Object, DicomServerOptions)
Starts the DICOM server listening for connections on the specified IP address(es) and port.
Declaration
public virtual Task StartAsync(string ipAddress, int port, ITlsAcceptor tlsAcceptor, Encoding fallbackEncoding, DicomServiceOptions serviceOptions, object userState, DicomServerOptions serverOptions)
Parameters
Type | Name | Description |
---|---|---|
System.String | ipAddress | IP address(es) for the server to listen to. |
System.Int32 | port | Port to which the server should be listening. |
ITlsAcceptor | tlsAcceptor | Handler to accept secure connections. |
System.Text.Encoding | fallbackEncoding | Encoding to apply if no encoding is identified. |
DicomServiceOptions | serviceOptions | Service options |
System.Object | userState | User state to be shared with the connected services. |
DicomServerOptions | serverOptions | Server options |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Awaitable System.Threading.Tasks.Task. |
Stop()
Stop server from further listening.
Declaration
public virtual void Stop()