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

  1.                         diag 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 is a diagnostic program used for checking the
  18. RPC mechanism.
  19.  
  20.  
  21.  
  22.  
  23. 3.  Keywords
  24.  
  25. diagnostic program, persistent binding, linked list, Traps,
  26. RPC macros
  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.      diag.rpc      RPC interface specification for this
  71.                    example
  72.  
  73.  
  74.  
  75.  
  76. 5.  Network Configuration
  77.  
  78. Before you can run this example, you may have to ask your
  79. system administrator to configure your system specifically
  80. for your needs.  The required configuration is described in
  81. the file: ..\..\READSPX
  82.  
  83.  
  84.  
  85.  
  86. 6.  Server Name
  87.  
  88. As distributed, the server for this example will register
  89. under the name "example".  However, it is strongly suggested
  90. that a unique server name be assigned to this example before
  91. it is built.
  92.  
  93. A unique server name will prevent two or more users from
  94. invoking a server process using the same server name.
  95. Choose a server name not likely to be selected by someone
  96. else.  For example, use your user or login name.
  97.  
  98. The server name must be changed in both the client and the
  99. server, and the SAME name must be used.  To change the
  100. server name for the client program, change to the client
  101. directory (client) and edit the file client.c.  Change the
  102. #define Server_Name statement as follows:
  103.  
  104.       #define Server_Name "example"
  105.           is changed to
  106.       #define Server_Name "myname"
  107.  
  108. To change the server name for the server program, change to
  109. the server directory (server) and edit the file serv_def.h,
  110. which contains the define statements for the server control
  111. procedure.  As with the client program, simply change the
  112. #define Server_Name statement.
  113.  
  114.  
  115.  
  116.  
  117. 7.  Building Client & Server
  118.  
  119. Procedures are included for building the example program.
  120. These procedures assume that your environment is set up as
  121. follows:
  122.  
  123.    - The PATH environment variable must specify the location
  124.      of the RPC Compiler executable files.
  125.  
  126.    - The LIB environment variable must specify the location
  127.      of the RPC runtime libraries.
  128.  
  129.    - The INCLUDE environment variable must specify the
  130.      location of the RPC .h include files.
  131.  
  132.    - The PDUDIR environment variable must specify the
  133.      location of the RPC .rpc files.
  134.  
  135.    - The RPCSCP environment variable must specify the
  136.      location of the RPC server control procedures.
  137.  
  138. The PATH, LIB, and INCLUDE environment variables should be
  139. set in your autoexec.bat file by modifying their current
  140. definitions. The PDUDIR and RPCSCP environment variables can
  141. be set in your autoexec.bat file, or in a local .bat file,
  142. or directly with the "set" command.
  143.  
  144. Since a distributed application runs on two machines, you
  145. must install an executable version of the client or server
  146. on another machine.  If the two machines are identical, you
  147. can build both executables (the client and server) on one
  148. machine and then move one of the executables.  However, if
  149. the two machines are not identical, you must follow the
  150. directions on the other machine for running this example and
  151. build one of the executable programs there (note that the
  152. executable filenames may differ across products).
  153.  
  154. Note that with the Microsoft C Compiler and utilities,
  155. numerous warnings will be generated when executing the
  156. makefiles. For example, you may see a "target does not
  157. exist" or "module not in library" warning. These simply mean
  158. that the file the makefile is currently creating does not
  159. yet exist. Generally, all warnings may be ignored.
  160.  
  161. To build the example program, you simply execute the build
  162. procedures in each subdirectory as follows:
  163.  
  164.   1.  Change to the client directory (client) and build the
  165.       client:
  166.  
  167.            make client.mk
  168.  
  169.   2.  Change to the server directory (server) and build the
  170.       server:
  171.  
  172.            make server.mk
  173.  
  174.  
  175.  
  176.  
  177.  
  178. 8.  Running the Distributed Application
  179.  
  180. The server program should be started before the client
  181. program is run.
  182.  
  183. To run the example on two machines, proceed as follows:
  184.  
  185.   1.  Change to the server directory (server) on the machine
  186.       running the server and start the server:
  187.  
  188.            server
  189.  
  190.   2.  Change to the client directory (client) on the machine
  191.       running the client and start the client:
  192.  
  193.            client
  194.  
  195.  
  196.  
  197.  
  198.  
  199. 9.  Description
  200.  
  201. This diagnostic program performs the following steps:
  202.  
  203.   1.  Performs simple, non-persistent RPCs
  204.  
  205.   2.  Establishes a persistent connection
  206.  
  207.   3.  Performs RPCs with simple data types
  208.  
  209.   4.  Performs RPCs with complex data types
  210.  
  211.   5.  Closes the persistent connection
  212.  
  213.   6.  Performs additional, non-persistent RPCs
  214.  
  215. Using this diagnostic code, you can test the basic integrity
  216. of the RPC mechanism and the underlying transport.
  217.  
  218. Additional details of non-persistent connections, persistent
  219. connections, linked lists, and error handling can be found
  220. in other examples.
  221.