ACSE/Presentation and ROSE Interface Programmer's Guide

38 Chapter 3
Using ACSE/Presentation
Step 2: Establish an Association
Figure 3-6 Request Association
Confirm the Association
When a request has been received by checking the ap_poll() events
parameter, Process B calls ap_rcv() and receives A_ASSOC_IND. Process
B must find out what the proposed transfer syntaxes are by calling
ap_get_env() using the AP_PCDL attribute.
It checks the transfer syntax to Process A's proposed syntax. If Process B
determines that the syntax is valid, Process B calls ap_set_env() using
the AP_PCDRL attribute to set its transfer syntax. Process B sets the res
field in the structure ap_cdrl_t to ACCPT and the transfer syntax pointer
to the supported transfer syntax object id. Process B then calls ap_snd()
using the A_ASSOC_RSP primitive to accept the association request.
(See Figure 3-7.)
Process A must wait for Process B to respond with the connection
response by using ap_poll() or by making a synchronous ap_rcv() call.
Communication
Communication
Endpoint A
Endpoint B
Process A Process B
AP Environment A
AP Environment B
Initiator
Responder
remote p-address,
appl. context name
pres. context def. list
ap_snd()
request assoc.
ap_poll()
(listening)