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

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