Dicom server C-STORE request and linked association

107 views
Skip to first unread message

Anthony Cox

unread,
Sep 22, 2021, 12:48:17 AM9/22/21
to Fellow Oak DICOM
I have a DICOM server running accepting a C-STORE.  When processing each CSTORE request, I would like to find the association (connection) that is in use for this request so I can store all DICOM files received in the same location related to the association.  And when the association is closed would the like to trigger an event for the files received.

Current solution works if only 1 association is open but when concurrent associations occur we do not know what association is for what.

I found the CSTORE request has no info on what association is in use and the OnAssociationClosed does not indicate which association is closing.  Seems there is also no unique identifier in the association either.  Looks like the DicomServer is supporting a single Association instance only.

Has anyone come across this situation before and if so how did you link the association to the request? 

Kind Regards,  Anthony

Reinhard Gruber

unread,
Oct 13, 2021, 1:37:05 PM10/13/21
to Fellow Oak DICOM
Actually you do have the information.
When you start a DICOM server, then this instance is typed (e.g. `DicomServer<MyStoreSCPImplentation>`), where this type has to be derived from `DicomService`. 
On every networkconnection the DICOM server creates a new separate instance of type `MyStoreSCPImplementation` and holds this instance as long as the network connection lives. `DicomService` has some properties like `Association`. So within your handler of `OnCStoreRequestAsync` as well as within `OnConnectionClosed` (this is more save to use, because `OnReceiveAssociationReleaseRequestAsync` is only called if the association is terminated normally, but not if the network connection breaks for some other reason) you do have access to the `Association` property. Furthermore you can implement your own fields and properties within this class, like counters or logger or similar, that are unique per association.

Greetings,
Reinhard 

Reply all
Reply to author
Forward
0 new messages