ACSE/Presentation and ROSE Interface Programmer's Guide

Chapter 4 59
Programming Guide
5. Managing Multiple Connections
packets and is waiting for the release indication (A_RELEASE_IND)
while endpoint D is in AP_IDLE state waiting for the connection
indication (A_ASSOC_IND).
Figure 4-1 Multiple Connections Scenario
If the connections are using synchronous mode, a deadlock situation
occurs. Endpoint A is blocked until endpoint B receives a
A_ASSOC_CNF which will never happen, because the remote process
is servicing endpoint C which is waiting for A_RELEASE_REQ sent
by endpoint A and endpoint A is blocked.
On the other hand, using asynchronous mode, ap_rcv() will return
AP_AGAIN on communication endpoint B because there is no data to
process. It would not block the process, and the application can
continue to service the next connection. Communication endpoint A
would then be able to receive its last data packet and send a release
request (A_RELEASE_REQ) to endpoint C. Then C would be able to
process its release indication (A_RELEASE_IND) and reply
(A_RELEASE_RSP). Endpoint D would receive its connection
indication (A_ASSOC_IND) and so on.
For more information on how an application can handle synchronous and
asynchronous mode processing, see the section “Using Synchronous vs.
Asynchronous Mode.”.
Initiator Process Responder Process
====================================================
servicing servicing
Conn B
Conn C
.sent A_ASSOC_REQ
.waiting for
A_ASSOC_CNF
.sent all data packets
.waiting for
A_RELEASE_IND
Conn A
.sent all data packets
.waiting for its turn
to receive its last
data packet before
it sends A_RELEASE_REQ
Conn D
.in IDLE state
.waiting for
A_ASSOC_IND