pynetdicom.dul.DULServiceProvider¶
- class pynetdicom.dul.DULServiceProvider(assoc: Association)[source]¶
The DICOM Upper Layer Service Provider.
- to_provider_queue¶
Queue of primitives received from the peer to be processed by the service user.
- Type:
- to_user_queue¶
Queue of processed PDUs for the DUL service user.
- Type:
- event_queue¶
List of queued events to be processed by the state machine.
- Type:
- state_machine¶
The DICOM Upper Layer’s State Machine.
- Type:
- __init__(assoc: Association) None [source]¶
Create a new DUL service provider for assoc.
- Parameters:
assoc (association.Association) – The DUL’s parent
Association
instance.
Methods
__init__
(assoc)Create a new DUL service provider for assoc.
getName
()Return a string used for identification purposes only.
Return
True
if the network idle timer has expired.isDaemon
()Return whether this thread is a daemon.
is_alive
()Return whether the thread is alive.
join
([timeout])Wait until the thread terminates.
kill_dul
()Kill the DUL reactor and stop the thread
Check the next PDU to be processed.
receive_pdu
([wait, timeout])Return an item from the queue if one is available.
run
()Method representing the thread's activity.
Run the DUL reactor.
send_pdu
(primitive)Place a primitive in the provider queue to be sent to the peer.
setDaemon
(daemonic)Set whether this thread is a daemon.
setName
(name)Set the name string for this thread.
start
()Start the thread's activity.
stop_dul
()Stop the reactor if current state is
'Sta1'
Attributes
Return the parent
Association
.daemon
A boolean value indicating whether this thread is a daemon thread.
ident
Thread identifier of this thread or None if it has not been started.
name
A string used for identification purposes only.
native_id
Native integral thread ID of this thread, or None if it has not been started.
Return the network timeout (in seconds).
- property assoc: Association¶
Return the parent
Association
.
- peek_next_pdu() A_ASSOCIATE | A_RELEASE | A_ABORT | A_P_ABORT | P_DATA | None [source]¶
Check the next PDU to be processed.
- receive_pdu(wait: bool = False, timeout: float | None = None) A_ASSOCIATE | A_RELEASE | A_ABORT | A_P_ABORT | P_DATA | None [source]¶
Return an item from the queue if one is available.
Get the next service primitive to be processed out of the queue of items sent from the DUL service provider to the service user
- Parameters:
- Returns:
The next primitive in the
to_user_queue
, orNone
if the queue is empty.- Return type:
Optional[Union[A_ASSOCIATE, A_RELEASE, A_ABORT, A_P_ABORT]]
- run_reactor() None [source]¶
Run the DUL reactor.
The main
threading.Thread
run loop. Runs constantly, checking the connection for incoming data. When incoming data is received it categorises it and add its to theto_user_queue
.
- send_pdu(primitive: A_ASSOCIATE | A_RELEASE | A_ABORT | A_P_ABORT | P_DATA) None [source]¶
Place a primitive in the provider queue to be sent to the peer.
Primitives are converted to the corresponding PDU and encoded before sending.
- Parameters:
primitive (pdu_primitives.PDU sub-class) –
A service primitive, one of: