pynetdicom.dul.DULServiceProvider¶
-
class
pynetdicom.dul.
DULServiceProvider
(assoc)¶ The DICOM Upper Layer Service Provider.
-
socket
¶ A wrapped socket.socket object used to communicate with the peer.
-
to_provider_queue
¶ Queue of PDUs from the DUL service user to be processed by the DUL provider.
- Type
queue.Queue
-
to_user_queue
¶ Queue of primitives from the DUL service to be processed by the DUL user.
- Type
queue.Queue
-
event_queue
¶ List of queued events to be processed by the state machine.
- Type
queue.Queue
-
state_machine
¶ The DICOM Upper Layer’s State Machine.
- Type
-
__init__
(assoc)¶ 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
True
if the network idle timer has expired.isAlive
()Return whether the thread is alive.
isDaemon
()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
()Run the DUL reactor.
send_pdu
(primitive)Place a primitive in the provider queue to be sent to the peer.
setDaemon
(daemonic)setName
(name)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
¶ Return the parent
Association
.
-
idle_timer_expired
()¶ Return
True
if the network idle timer has expired.
-
kill_dul
()¶ Kill the DUL reactor and stop the thread
-
property
network_timeout
¶ Return the network timeout (in seconds).
-
peek_next_pdu
()¶ Check the next PDU to be processed.
-
receive_pdu
(wait=False, timeout=None)¶ Return an item from the queue if one is available.
Get the next item to be processed out of the queue of items sent from the DUL service provider to the service user
- Parameters
wait (bool, optional) – If wait is
True
and timeout isNone
, blocks until an item is available. If timeout is a positive number, blocks at most timeout seconds. Otherwise returns an item if one is immediately available.timeout (int or None) – See the definition of wait
- Returns
object – The next object in the
to_user_queue
.None – If the queue is empty.
-
run
()¶ 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)¶ 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:
-
stop_dul
()¶ Stop the reactor if current state is
'Sta1'
- Returns
True
if'Sta1'
and the reactor has stopped,False
otherwise- Return type
bool
-