home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c004 / 4.ddi / NETBIOS / README.CUP < prev    next >
Encoding:
Text File  |  1989-04-18  |  3.3 KB  |  68 lines

  1.               DOS Aborted Application Cleanup
  2.  
  3. In the MS-DOS environment, the connection between the application and
  4. the server will not be properly closed on abnormal program exits unless
  5. certain steps are taken to clean up the application-server connection.
  6. Ordinarily, an application directly (or indirectly via CLISAM) cleans up
  7. the connection by a call to STPUSR().
  8.  
  9. When an application abnormally terminates, disconnect() must be called.
  10. c-tree includes several methods of handling control-c and critical errors.
  11. In short, the net result should be that disconnect() is called before
  12. the application exits, whether done by the c-tree default routines or a
  13. user abnormal exit handler.  c-tree actions can be specified by setting
  14. the constants CBRKmode and CERRmode.  These are in ctaxit.h.
  15.  
  16. CBRKmode defines the actions performed on a control-c interrupt (int
  17. 23).  Possible values are:
  18.  
  19.   CBRK_NONE - Do not install the c-tree interrupt 23 handler.  This
  20.               would be used when a user-supplied handler is already
  21.               in place.  Another case is when using console I/O
  22.               routines that treat control-c and control-break as
  23.               normal characters or otherwise inhibit the abort.  If the
  24.           control-c causes an abort, be sure to call disconnect().
  25.  
  26.   CBRK_DFL  - The interrupt 23h handler is installed.  When an abort
  27.               due to control-c is signaled, then the handler will
  28.               call disconnect(), then let the program terminate.
  29.  
  30.   CBRK_IGN  - The handler is installed, however, the handler returns
  31.               "ignore" status to MS-DOS (The newline/^C is still
  32.               echoed to the screen; you must use other i/o techniques
  33.               to avoid this).
  34.  
  35. CERRmode defines the actions performed on a critical error interrupt (int
  36. 24).  Possible values are:
  37.  
  38.   CERR_NONE - Do not install the c-tree interrupt 24 handler.  This
  39.               would be used when a user-supplied handler is already
  40.               in place.  The existing handler should be modified to
  41.               call disconnect() if c-tree has been activated.
  42.  
  43.   CERR_DFL  - The handler is installed.  It passes control to the
  44.               default handler, i.e., prompt user for intervention.
  45.               If the returned status from the default handler
  46.               specifies abort (i.e., user selected Abort), then
  47.               disconnect() is called.  Since, in this mode, the handler
  48.               "chains" to the next handler, it can be used with an
  49.               existing user or library supplied handler if the
  50.               user/library handler is installed BEFORE c-tree routines
  51.               are called, thus avoiding changes to existing handler
  52.               code.
  53.  
  54.   CERR_FAIL - The handler is installed.  When a critical error occurs,
  55.               the handler returns status to MS-DOS indicating that
  56.               the call should return the error to the program that
  57.               made the system call.  The calling program will receive
  58.               DOS error 0x83 (and can get extended error codes if
  59.               desired).
  60.  
  61.  
  62. There are other abnormal termination reasons not covered by the c-tree
  63. handler such as floating point error (trap with signal()).  Any
  64. handlers for these should call disconnect() if c-tree has been
  65. activated and the program will be aborted.
  66.  
  67. end of readme.cup
  68.