home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / PERSIST / COMMON / PERSIST.RPC
Encoding:
Text File  |  1989-12-11  |  2.8 KB  |  78 lines

  1. %h{
  2. /*                                                                            *
  3.  *                                                                            *
  4.  *                  Copyright 1987, 1988, 1989 Netwise, Inc.                  *
  5.  *                              All Rights Reserved                           *
  6.  *   This software contains information which is proprietary to and a trade   *
  7.  *   secret of Netwise, Inc. It is not to be used, reproduced, or disclosed   *
  8.  *   except as authorized in your license agreement.                          *
  9.  *                                                                            *
  10.  *                          Restricted Rights Legend                          *
  11.  *   Use, duplication,  or  disclosure  by the  Government  is  subject  to   *
  12.  *   restrictions as set forth in subparagraph (c)(1)(ii) of the Rights  in   *
  13.  *   Technical Data and  Computer Software clause  at 252.227-7013, or  the   *
  14.  *   equivalent Government clause for other agencies.                         *
  15.  *   Contractor: Netwise, Inc., Boulder, CO 80301 USA                         *
  16.  *                                                                            *
  17.  */ 
  18. %}
  19.  
  20. /*
  21.  * File: persist\common\persist.rpc
  22.  *
  23.  * This example runs in the following environment:
  24.  *    NetWare RPC 1.0, NetWare 2.1 or higher, DOS 3.3
  25.  *
  26.  * This is the RPC Specification File for the persist example.
  27.  *
  28.  */ 
  29.  
  30. /* Declare connection identifier for procedures without
  31.  * explicit binding declarartions.  This connection
  32.  * identifier designates persistent connection with
  33.  * the server.
  34.  */
  35.  
  36. extern connection_id [bind in out] conn;
  37.  
  38. /* Declare start procedure so that it takes a server name
  39.  * as a parameter and, therefore, opens a connection with
  40.  * the server.  The connection identifier is placed in the
  41.  * global variable conn, so that the identifier can be used
  42.  * by other remote procedures.  This is the Persistent Open
  43.  * style of process binding.
  44.  */
  45.  
  46. int
  47. start( server_name [bind in] sname)
  48. {
  49.     extern connection_id [bind out] conn;
  50. }
  51.  
  52.  
  53. /* Declare stop procedure so that it uses the the persistent
  54.  * connection.  However, because no ouput binding parameter
  55.  * or variable is declared, the connection is closed upon
  56.  * completing the call to the stop procedure.  This is the
  57.  * Persistent Close style of process binding.
  58.  */
  59.  
  60. int
  61. stop()
  62. {
  63.     extern connection_id [bind in] conn;
  64. }
  65.  
  66. /* Remaining procedures are declared without process binding
  67.  * declarations; therefore, these procedures implicitly use
  68.  * the global variable conn for obtaining the connection
  69.  * identifier designating the persistent connection.  This is
  70.  * the Persistent Use style of process binding.
  71.   */
  72.  
  73. int
  74. add( int a, int b);
  75.  
  76. int
  77. sub( int a, int b);
  78.