Significance of AssociationClosed Event
Should I use AssociationClosed Event ?
AssociationClosed Event is by default disabled as it is very easy for most people to misuse it. If you need to use it you have to first enable it either by adding a real registry entry "DisableAssociationClosed" in the registry:
or using DicomGlobal function:
In COM version: Dim g As New DicomGlobal g.RegWord("DisableAssociationClosed") = 0 In .NET version DicomObjects.DicomGlobal.SetRegWord("DisableAssociationClosed", 0)
The reason why we are NOT encouraging our developers to use this event is that it is very easy for people to misuse it. A typical and very common mistake is assuming the end of one association is the end of transfer of one Study, or Series, etc. This is explained more fully in Some_Systems_Behave_Badly_when_sent_One_Image_Per_Association
Situations where AssociationClosed can/should be used are:
- Dicom Printing, where information should be dropped after each printing job has completed
- Simple operations, like logging the total number of images transferred, or total bytes transferred through out the entire association.