pynetdicom.acse.ACSE

class pynetdicom.acse.ACSE(assoc: Association)

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

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.

is_release_requested()

Return True if an A-RELEASE request has been received.

negotiate_association()

Perform an association negotiation as either the requestor or acceptor.

negotiate_release()

Negotiate association release.

send_abort(source)

Send an A-ABORT request to the peer.

send_accept()

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_request()

Send an A-ASSOCIATE (request) to the peer.

Attributes

acceptor

Return the acceptor ServiceUser.

acse_timeout

Return the ACSE timeout (in seconds).

assoc

Return the parent Association.

dul

Return the DULServiceProvider.

requestor

Return the requestor ServiceUser.

socket

Return the AssociationSocket.

property acceptor

Return the acceptor ServiceUser.

property acse_timeout

Return the ACSE timeout (in seconds).

property assoc

Return the parent Association.

New in version 1.3.

property dul

Return the DULServiceProvider.

is_aborted(abort_type: str = 'both') → bool

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 return True if an A-ABORT or A-P-ABORT is received (default). If 'a-abort' then will return True if an A-ABORT is received, if 'a-p-abort' then will return True if an A-P-ABORT is received.

Returns

True if an abort is received, False otherwise.

Return type

bool

is_release_requested() → bool

Return True if an A-RELEASE request has been received.

New in version 1.1.

negotiate_association() → None

Perform an association negotiation as either the requestor or acceptor.

negotiate_release() → None

Negotiate association release.

New in version 1.1.

Once an A-RELEASE request has been sent any received P-DATA PDUs will be ignored.

property requestor

Return the requestor ServiceUser.

send_abort(source: int) → None

Send an A-ABORT request to the peer.

Parameters

source (int) –

The source of the abort request

  • 0x00 - the DUL service user

  • 0x02 - the DUL service provider

Raises

ValueError – If the source value is invalid.

send_accept() → None

Send an A-ASSOCIATE (accept) to the peer.

send_ap_abort(reason: int) → None

Send an A-P-ABORT to the peer.

Parameters

reason (int) –

The reason for aborting the association, one of the following:

  • 0x00 - reason not specified

  • 0x01 - unrecognised PDU

  • 0x02 - unexpected PDU

  • 0x04 - unrecognised PDU parameter

  • 0x05 - unexpected PDU parameter

  • 0x06 - invalid PDU parameter value

Raises

ValueError – If the reason value is invalid.

send_reject(result: int, source: int, diagnostic: int) → None

Send an A-ASSOCIATE (reject) to the peer.

Parameters
  • result (int) –

    The association rejection:

    • 0x01 - rejected permanent

    • 0x02 - rejected transient

  • source (int) –

    The source of the rejection:

    • 0x01 - DUL service user

    • 0x02 - 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 given

    • 0x02 - application context name not supported

    • 0x03 - calling AE title not recognised

    • 0x07 - called AE title not recognised

    If the source is 0x02:

    • 0x01 - no reason given

    • 0x02 - protocol version not supported

    If the source is 0x03:

    • 0x01 - temporary congestion

    • 0x02 - local limit exceeded

send_release(is_response: bool = False) → None

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).

send_request() → None

Send an A-ASSOCIATE (request) to the peer.

property socket

Return the AssociationSocket.