home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / TUTORIAL / README
Encoding:
Text File  |  1989-12-11  |  6.0 KB  |  209 lines

  1.                       tutorial Example
  2.  
  3.  
  4.  
  5.  
  6. 1.  Environment
  7.  
  8. This example is designed to be built and executed on a PC
  9. that runs DOS, the Microsoft C Compiler and utilities, and
  10. that uses the NetWare network library.
  11.  
  12.  
  13.  
  14.  
  15. 2.  Overview
  16.  
  17. See Chapter 3, "Tutorial," in the NetWare RPC User's Manual
  18. for a description of the tutorial example.
  19.  
  20.  
  21.  
  22.  
  23. 3.  Keywords
  24.  
  25. tutorial, structure, union, termination expression, choice
  26. expression, process binding
  27.  
  28.  
  29.  
  30.  
  31. 4.  Files
  32.  
  33. Source files for this example reside in the following sub-
  34. directories:
  35.  
  36. server:
  37.  
  38.      Contains code and build procedures for the server part
  39.      of this distributed application.  The server consists
  40.      of the server control procedure, which is provided with
  41.      the product distribution, the dispatcher procedure and
  42.      server stub routines, which are generated by the RPC
  43.      Compiler, and the remote procedures, which are provided
  44.      with this example.
  45.  
  46.      rproc.c       remote procedure application code
  47.  
  48.      server.mk     makefile for building the server
  49.  
  50.      serv_def.h    include file with macro definitions for
  51.                    the server control procedure
  52.  
  53. client:
  54.  
  55.      Contains code and build procedures for the client part
  56.      of this distributed application.  The client consists
  57.      of the client main program and any associated routines,
  58.      which are provided with this example, and the client
  59.      stubs, which are generated by the RPC compiler.
  60.  
  61.      client.c      client application code (main program)
  62.  
  63.      client.mk     makefile for building the client
  64.  
  65. common:
  66.  
  67.      Contains the RPC interface specification used by the
  68.      RPC compiler to create the client and server stubs.
  69.  
  70.      database.rpc  RPC interface specification for this
  71.                    example
  72. stdalone:
  73.  
  74.      Contains a stand-alone version of the example, which
  75.      performs the same function as the distributed version.
  76.  
  77.      stdalone.c    Stand-alone program source code
  78.  
  79.  
  80.  
  81.  
  82. 5.  Network Configuration
  83.  
  84. Before you can run this example, you may have to ask your
  85. system administrator to configure your system specifically
  86. for your needs.  The required configuration is described in
  87. the file: ..\..\READSPX
  88.  
  89.  
  90.  
  91.  
  92. 6.  Server Name
  93.  
  94. As distributed, the server for this example will register
  95. under the name "example".  However, it is strongly suggested
  96. that a unique server name be assigned to this example before
  97. it is built.
  98.  
  99. A unique server name will prevent two or more users from
  100. invoking a server process using the same server name.
  101. Choose a server name not likely to be selected by someone
  102. else.  For example, use your user or login name.
  103.  
  104. The server name must be changed in both the client and the
  105. server, and the SAME name must be used.  To change the
  106. server name for the client program, change to the client
  107. directory (client) and edit the file client.c.  Change the
  108. #define Server_Name statement as follows:
  109.  
  110.       #define Server_Name "example"
  111.           is changed to
  112.       #define Server_Name "myname"
  113.  
  114. To change the server name for the server program, change to
  115. the server directory (server) and edit the file serv_def.h,
  116. which contains the define statements for the server control
  117. procedure.  As with the client program, simply change the
  118. #define Server_Name statement.
  119.  
  120.  
  121.  
  122.  
  123. 7.  Building Client & Server
  124.  
  125. Procedures are included for building the example program.
  126. These procedures assume that your environment is set up as
  127. follows:
  128.  
  129.    - The PATH environment variable must specify the location
  130.      of the RPC Compiler executable files.
  131.  
  132.    - The LIB environment variable must specify the location
  133.      of the RPC runtime libraries.
  134.  
  135.    - The INCLUDE environment variable must specify the
  136.      location of the RPC .h include files.
  137.  
  138.    - The PDUDIR environment variable must specify the
  139.      location of the RPC .rpc files.
  140.  
  141.    - The RPCSCP environment variable must specify the
  142.      location of the RPC server control procedures.
  143.  
  144. The PATH, LIB, and INCLUDE environment variables should be
  145. set in your autoexec.bat file by modifying their current
  146. definitions. The PDUDIR and RPCSCP environment variables can
  147. be set in your autoexec.bat file, or in a local .bat file,
  148. or directly with the "set" command.
  149.  
  150. Since a distributed application runs on two machines, you
  151. must install an executable version of the client or server
  152. on another machine.  If the two machines are identical, you
  153. can build both executables (the client and server) on one
  154. machine and then move one of the executables.  However, if
  155. the two machines are not identical, you must follow the
  156. directions on the other machine for running this example and
  157. build one of the executable programs there (note that the
  158. executable filenames may differ across products).
  159.  
  160. Note that with the Microsoft C Compiler and utilities,
  161. numerous warnings will be generated when executing the
  162. makefiles. For example, you may see a "target does not
  163. exist" or "module not in library" warning. These simply mean
  164. that the file the makefile is currently creating does not
  165. yet exist. Generally, all warnings may be ignored.
  166.  
  167. To build the example program, you simply execute the build
  168. procedures in each subdirectory as follows:
  169.  
  170.   1.  Change to the client directory (client) and build the
  171.       client:
  172.  
  173.            make client.mk
  174.  
  175.   2.  Change to the server directory (server) and build the
  176.       server:
  177.  
  178.            make server.mk
  179.  
  180.  
  181.  
  182.  
  183.  
  184. 8.  Running the Distributed Application
  185.  
  186. The server program should be started before the client
  187. program is run.
  188.  
  189. To run the example on two machines, proceed as follows:
  190.  
  191.   1.  Change to the server directory (server) on the machine
  192.       running the server and start the server:
  193.  
  194.            server
  195.  
  196.   2.  Change to the client directory (client) on the machine
  197.       running the client and start the client:
  198.  
  199.            client
  200.  
  201.  
  202.  
  203.  
  204.  
  205. 9.  Description
  206.  
  207. See Chapter 3, "Tutorial," in the NetWare RPC User's Manual
  208. for a description of the tutorial example.
  209.