pynetdicom.acse.ACSE¶
- class pynetdicom.acse.ACSE(assoc: Association)[source]¶
The Association Control Service Element (ACSE) service provider.
The ACSE protocol handles association negotiation and establishment, and normal and abnormal release of an association.
- __init__(assoc: Association) None [source]¶
Create the ACSE service provider.
- Parameters:
assoc (association.Association) – The Association to provide ACSE services for.
Methods
__init__
(assoc)Create the ACSE service provider.
is_aborted
([abort_type])Return
True
if an A-ABORT and/or A-P-ABORT request has been received.Return
True
if an A-RELEASE request has been received.Perform an association negotiation as either the requestor or acceptor.
Negotiate association release.
send_abort
(source)Send an A-ABORT request to the peer.
Send an A-ASSOCIATE (accept) to the peer.
send_ap_abort
(reason)Send an A-P-ABORT to the peer.
send_reject
(result, source, diagnostic)Send an A-ASSOCIATE (reject) to the peer.
send_release
([is_response])Send an A-RELEASE (request or response) to the peer.
Send an A-ASSOCIATE (request) to the peer.
Attributes
Return the acceptor
ServiceUser
.Return the ACSE timeout (in seconds).
Return the parent
Association
.Return the
DULServiceProvider
.Return the requestor
ServiceUser
.Return the
AssociationSocket
.- property acceptor: ServiceUser¶
Return the acceptor
ServiceUser
.
- property assoc: Association¶
Return the parent
Association
.Added in version 1.3.
- property dul: DULServiceProvider¶
Return the
DULServiceProvider
.
- is_aborted(abort_type: str = 'both') bool [source]¶
Return
True
if an A-ABORT and/or A-P-ABORT request has been received.Changed in version 1.5: Added abort_type keyword parameter.
- Parameters:
abort_type (str, optional) – The type of abort to check for. If
'both'
then will returnTrue
if an A-ABORT or A-P-ABORT is received (default). If'a-abort'
then will returnTrue
if an A-ABORT is received, if'a-p-abort'
then will returnTrue
if an A-P-ABORT is received.- Returns:
True
if an abort is received,False
otherwise.- Return type:
- is_release_requested() bool [source]¶
Return
True
if an A-RELEASE request has been received.Added in version 1.1.
- negotiate_association() None [source]¶
Perform an association negotiation as either the requestor or acceptor.
- negotiate_release() None [source]¶
Negotiate association release.
Added in version 1.1.
Once an A-RELEASE request has been sent any received P-DATA PDUs will be ignored.
- property requestor: ServiceUser¶
Return the requestor
ServiceUser
.
- send_abort(source: int) None [source]¶
Send an A-ABORT request to the peer.
- Parameters:
source (int) –
The source of the abort request
0x00
- the DUL service user0x02
- the DUL service provider
- Raises:
ValueError – If the source value is invalid.
- send_ap_abort(reason: int) None [source]¶
Send an A-P-ABORT to the peer.
- Parameters:
reason (int) –
The reason for aborting the association, one of the following:
0x00
- reason not specified0x01
- unrecognised PDU0x02
- unexpected PDU0x04
- unrecognised PDU parameter0x05
- unexpected PDU parameter0x06
- invalid PDU parameter value
- Raises:
ValueError – If the reason value is invalid.
- send_reject(result: int, source: int, diagnostic: int) None [source]¶
Send an A-ASSOCIATE (reject) to the peer.
- Parameters:
result (int) –
The association rejection:
0x01
- rejected permanent0x02
- rejected transient
source (int) –
The source of the rejection:
0x01
- DUL service user0x02
- DUL service provider (ACSE related)0x03
- DUL service provider (presentation related)
diagnostic (int) –
The reason for the rejection, if the source is
0x01
:0x01
- no reason given0x02
- application context name not supported0x03
- calling AE title not recognised0x07
- called AE title not recognised
If the source is
0x02
:0x01
- no reason given0x02
- protocol version not supported
If the source is
0x03
:0x01
- temporary congestion0x02
- local limit exceeded
- send_release(is_response: bool = False) None [source]¶
Send an A-RELEASE (request or response) to the peer.
- Parameters:
is_response (bool, optional) –
True
to send an A-RELEASE (response) to the peer,False
to send an A-RELEASE (request) to the peer (default).
- property socket: AssociationSocket | None¶
Return the
AssociationSocket
.