Asynchronous Operations

From DicomObjectsWiki

Jump to: Navigation, search

A DicomConnection Object can be made to operate asynchronusly. To do this you must first define a DicomServer (withevents) or a DicomViewer Object. Then use the DicomViewer\DicomServer's New method to create the asynchronous DicomConnection. e.g.

Set Connection = Viewer.New("DicomConnection")
 'The DicomConnetion is now asynchronous

Operations invoked by the connection object happen on a new background thread (asynchronously).

connection.Find.........
'The find operation occurs on a new background thread

The returned responses can then be picked up in the DicomViewer\DicomServer's ActionComplete and ActionUpdate events.

Note that it is very important not to attempt any other operations on the DicomConnection object prior to the ActionComplete evetn firing, as only one asynchronous operation may be queued at any time, so trying to fire a second operation whilst the first is still in operation will cause the second call not to return until the first operation has completed.

NOTE- In the .NET Version of DicomObjects this arrangement has been made obsolete as a result of the free threaded model. see Conversion from the COM version of DicomObjects to the native .NET version

Personal tools