Table of Contents

Class AdvancedDicomClientAssociation

Namespace
FellowOakDicom.Network.Client.Advanced.Association
Assembly
fo-dicom.core.dll

Represents an open DICOM association.

public class AdvancedDicomClientAssociation : IAdvancedDicomClientAssociation, IDisposable
Inheritance
AdvancedDicomClientAssociation
Implements
Inherited Members
Extension Methods

Constructors

AdvancedDicomClientAssociation(IAdvancedDicomClientConnection, DicomAssociation, ILogger)

Initializes a new instance

public AdvancedDicomClientAssociation(IAdvancedDicomClientConnection connection, DicomAssociation association, ILogger logger)

Parameters

connection IAdvancedDicomClientConnection
association DicomAssociation
logger ILogger

Properties

Association

Contains information about the DICOM association that was opened

public DicomAssociation Association { get; }

Property Value

DicomAssociation

IsDisposed

Whether or not this association is already disposed.

public bool IsDisposed { get; }

Property Value

bool

Methods

AbortAsync(CancellationToken)

Sends a notification to the other AE that this association will be aborted Unlike an association release, an abort is not acknowledged by the other AE and can be performed at any time. Aborting an association may incur a loss of information, if for example it is performed while sending C-STORE requests.

public ValueTask AbortAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token that immediately cancels the abort notification. Note that the association will be left in an unusable state regardless.

Returns

ValueTask

A task that will complete when the association is aborted or the connection is closed by the other AE

Exceptions

ObjectDisposedException

When the association is already disposed

Dispose()

public void Dispose()

~AdvancedDicomClientAssociation()

The finalizer will be called when this instance is not disposed properly.

protected ~AdvancedDicomClientAssociation()

Remarks

Failing to dispose indicates wrong usage

ReleaseAsync(CancellationToken)

Sends a request to the other AE to release this association. Note that most PACS software close the open TCP connection immediately after an association release. Releasing an association is the proper way of cleaning it up after it is no longer necessary.

public ValueTask ReleaseAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token that immediately cancels the request. Note that the association will be left in an unusable state regardless.

Returns

ValueTask

A task that will complete when the association release has been acknowledged, the association is aborted or the connection is closed by the other AE.

Exceptions

ObjectDisposedException

When the association is already disposed

SendRequestAsync(DicomRequest, CancellationToken)

Sends a request over this association and returns the received responses from the other AE There is no guarantee that the message will be sent immediately. As part of the association handshake, a maximum number of asynchronously invoked DICOM requests is agreed upon. If the maximum number of pending DICOM requests has already been reached, this request will be enqueued and sent later, once older requests have been processed.

public IAsyncEnumerable<DicomResponse> SendRequestAsync(DicomRequest dicomRequest, CancellationToken cancellationToken)

Parameters

dicomRequest DicomRequest

The request to send

cancellationToken CancellationToken

The token that immediately cancels the request

Returns

IAsyncEnumerable<DicomResponse>

An asynchronous enumerable of responses. C-FIND or C-MOVE requests will typically receive back a pending response per SOP instance, and finally one last success response C-STORE and C-ECHO requests on the other hand typically only receives one response

Exceptions

OperationCanceledException

When the request is cancelled using the cancellationToken

IOException

When connection/socket issues occur

DicomNetworkException

When DICOM protocol issues occur

ObjectDisposedException

When the association is already disposed