Class AdvancedDicomClientAssociation
Represents an open DICOM association.
Inheritance
Inherited Members
Namespace: FellowOakDicom.Network.Client.Advanced.Association
Assembly: fo-dicom.core.dll
Syntax
public class AdvancedDicomClientAssociation : IAdvancedDicomClientAssociation, IDisposable
Constructors
AdvancedDicomClientAssociation(IAdvancedDicomClientConnection, DicomAssociation, ILogger)
Initializes a new instance
Declaration
public AdvancedDicomClientAssociation(IAdvancedDicomClientConnection connection, DicomAssociation association, ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
IAdvancedDicomClientConnection | connection | |
DicomAssociation | association | |
Microsoft.Extensions.Logging.ILogger | logger |
Properties
Association
Contains information about the DICOM association that was opened
Declaration
public DicomAssociation Association { get; }
Property Value
Type | Description |
---|---|
DicomAssociation |
IsDisposed
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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.
Declaration
public async ValueTask AbortAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The token that immediately cancels the abort notification. Note that the association will be left in an unusable state regardless. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A task that will complete when the association is aborted or the connection is closed by the other AE |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | When the association is already disposed |
Dispose()
Declaration
public void Dispose()
Finalize()
The finalizer will be called when this instance is not disposed properly.
Declaration
protected void Finalize()
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.
Declaration
public async ValueTask ReleaseAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The token that immediately cancels the request. Note that the association will be left in an unusable state regardless. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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
Type | Condition |
---|---|
System.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.
Declaration
public async IAsyncEnumerable<DicomResponse> SendRequestAsync(DicomRequest dicomRequest, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
DicomRequest | dicomRequest | The request to send |
System.Threading.CancellationToken | cancellationToken | The token that immediately cancels the request |
Returns
Type | Description |
---|---|
System.Collections.Generic.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
Type | Condition |
---|---|
System.OperationCanceledException | When the request is cancelled using the |
System.IO.IOException | When connection/socket issues occur |
DicomNetworkException | When DICOM protocol issues occur |
System.ObjectDisposedException | When the association is already disposed |