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

Other Tasks

Page 62 highlights

Programming Guide 6. Other Tasks 6. Other Tasks Other items to consider in developing A/P applications include: • File descriptors • Signal handling • Error checking File Descriptors Communication endpoints for ACSE/Presentation applications are HP-UX file descriptors. Because of unpredictable results, HP recommends you do not use HP-UX file system calls such as exec(2), dup(2), read(2), write(2), ioctl(2), or select(2) with HP OTS/9000 A CSE/Presentation file descriptors. Note that fork(2) can be used, but do not use fork(2) with exec(2). A communication endpoint is returned when the ACSE/Presentation call ap_open() is invoked. Note that the user may need to increase the open file limit for the application process to support a large number of connections. Refer to the getrlimit() and setrlimit() system call manpages for more information on changing file limits. Signal Handlers ACSE/Presentation calls interrupted by the arrival of a signal will not be restarted by the library. You are responsible for managing signals and providing recovery routines for the duration of any ACSE/Presentation calls. Signals are interrupts such as when you enter ˆC on a terminal to exit from a program. If an interrupt occurs while executing A/P functions, the operating system class error EINTR is returned. When detected, you must re-invoke the A/P function. If EINTR is detected while executing ap_snd() or ap_rcv(), the call must be invoked again as described in how to handle AP_AGAIN in the ap_snd() and ap_rcv() manpages (for both synchronous and asynchronous processing). The A/P library continues the call from where it left off. 62 Chapter 4

  • 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

62
Chapter 4
Programming Guide
6. Other Tasks
6. Other Tasks
Other items to consider in developing A/P applications include:
File descriptors
Signal handling
Error checking
File Descriptors
Communication endpoints for ACSE/Presentation applications are
HP-UX file descriptors. Because of unpredictable results, HP
recommends you do not use HP-UX file system calls such as exec(2),
dup(2), read(2), write(2), ioctl(2), or select(2) with HP OTS/9000 A
CSE/Presentation file descriptors. Note that fork(2) can be used, but do
not use fork(2) with exec(2).
A communication endpoint is returned when the ACSE/Presentation call
ap_open() is invoked.
Note that the user may need to increase the open file limit for the
application process to support a large number of connections. Refer to
the getrlimit() and setrlimit() system call manpages for more information
on changing file limits.
Signal Handlers
ACSE/Presentation calls interrupted by the arrival of a signal will not be
restarted by the library. You are responsible for managing signals and
providing recovery routines for the duration of any ACSE/Presentation
calls. Signals are interrupts such as when you enter ˆC on a terminal to
exit from a program.
If an interrupt occurs while executing A/P functions, the operating
system class error EINTR is returned. When detected, you must
re-invoke the A/P function. If EINTR is detected while executing
ap_snd() or ap_rcv(), the call must be invoked again as described in how
to handle AP_AGAIN in the ap_snd() and ap_rcv() manpages (for both
synchronous and asynchronous processing). The A/P library continues
the call from where it left off.