HP 800 ACSE/Presentation and ROSE Interface Programmer's Guide - Page 40

Step 3. Exchanging Data

Page 40 highlights

NOTE Using ACSE/Presentation Step 3. Exchanging Data Step 3. Exchanging Data Once an association is established, processes can send and receive control data (primitives) and user data. It is the responsibility of the process to encode and decode data with the selected transfer syntax. For complex data types, you can choose to use an ASN.1 compiler to assist in the creation of these routines. Process A retrieves its supported and negotiated transfer syntaxes by calling ap_get_env() using the AP_DCS attribute, and to find out the result of each proposed presentation context by calling ap_get_env() using AP_PCDRL to look at the res and prov_rsn fields. (See Figure 3-8.) Process A is now ready to send data using the P_DATA_REQ primitive in the ap_snd() call in the agreed upon presentation context. Process B uses ap_poll() to monitor events. The data received by ap_rcv() is indicated by the P_DATA_IND primitive. Note that the AP_ALLOC option is not supported. The buffer pointed to by ubuf must be allocated by the user. If the data received is more than the allocated buffer, the flags parameter AP_MORE bit is set. If set, continue to invoke ap_rcv() until the AP_MORE bit is off. Check the sptype parameter each time ap_rcv() is called. Some primitives such as A_ABORT_IND are not flow-controlled and may interrupt the receipt of a partially received primitive (for example, AP_MORE bit is set). If this occurs, any remaining data from the previous primitive is lost. Note that handling expedited data is not supported in this release. 40 Chapter 3

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109

40
Chapter 3
Using ACSE/Presentation
Step 3. Exchanging Data
Step 3. Exchanging Data
Once an association is established, processes can send and receive
control data (primitives) and user data.
It is the responsibility of the process to encode and decode data with the
selected transfer syntax. For complex data types, you can choose to use
an ASN.1 compiler to assist in the creation of these routines.
Process A retrieves its supported and negotiated transfer syntaxes by
calling ap_get_env() using the AP_DCS attribute, and to find out the
result of each proposed presentation context by calling ap_get_env()
using AP_PCDRL to look at the res and prov_rsn fields. (See Figure 3-8.)
Process A is now ready to send data using the P_DATA_REQ primitive in
the ap_snd() call in the agreed upon presentation context.
Process B uses ap_poll() to monitor events. The data received by ap_rcv()
is indicated by the P_DATA_IND primitive.
Note that the AP_ALLOC option is not supported. The buffer pointed to
by ubuf must be allocated by the user.
If the data received is more than the allocated buffer, the flags parameter
AP_MORE bit is set. If set, continue to invoke ap_rcv() until the
AP_MORE bit is off.
Check the sptype parameter each time ap_rcv() is called. Some
primitives such as A_ABORT_IND are not flow-controlled and may
interrupt the receipt of a partially received primitive (for example,
AP_MORE bit is set). If this occurs, any remaining data from the
previous primitive is lost.
NOTE
Note that handling expedited data is not supported in this release.