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

  1.                        quick 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. The Quick Start Manual is the primary guide to building this
  18. example.  Use this README as a supplement to the manual.
  19.  
  20.  
  21.  
  22.  
  23. 3.  Keywords
  24.  
  25. non-persistent process binding, quick
  26.  
  27.  
  28.  
  29.  
  30. 4.  Files
  31.  
  32. Source files for this example reside in the following sub-
  33. directories:
  34.  
  35. server:
  36.  
  37.      Contains code and build procedures for the server part
  38.      of this distributed application.  The server consists
  39.      of the server control procedure, which is provided with
  40.      the product distribution, the dispatcher procedure and
  41.      server stub routines, which are generated by the RPC
  42.      Compiler, and the remote procedures, which are provided
  43.      with this example.
  44.  
  45.      rproc.c       remote procedure application code
  46.  
  47.      server.mk     makefile for building the server
  48.  
  49.      serv_def.h    include file with macro definitions for
  50.                    the server control procedure
  51.  
  52. client:
  53.  
  54.      Contains code and build procedures for the client part
  55.      of this distributed application.  The client consists
  56.      of the client main program and any associated routines,
  57.      which are provided with this example, and the client
  58.      stubs, which are generated by the RPC compiler.
  59.  
  60.      client.c      client application code (main program)
  61.  
  62.      client.mk     makefile for building the client
  63.  
  64. common:
  65.  
  66.      Contains the RPC interface specification used by the
  67.      RPC compiler to create the client and server stubs.
  68.  
  69.      quick.rpc     RPC interface specification for this
  70.                    example
  71.  
  72.  
  73.  
  74.  
  75. 5.  Network Configuration
  76.  
  77. Before you can run this example, you may have to ask your
  78. system administrator to configure your system specifically
  79. for your needs.  The required configuration is described in
  80. the file: ..\..\READSPX
  81.  
  82.  
  83.  
  84.  
  85. 6.  Server Name
  86.  
  87. The macro Server_Name is defined as "example" in the
  88. distributed code.  This name is used in both the client code
  89. and the server code to identify the server application
  90. process.  In the client code, the variable 'sname' is
  91. assigned the value of Server_Name (possibly concatenated
  92. with a hostname, etc.).  The variable 'sname' is also used
  93. in the process binding declaration so that the RPC Compiler
  94. may generate code that uses the name specified by 'sname' to
  95. locate the appropriate server application process when a
  96. remote procedure is called.
  97.  
  98. There are 2 places in the Quick Start exercise where you
  99. will use the Server_Name macro.  First you are asked to find
  100. the statements added to client.c.  In the second place, you
  101. will add a define statement for the Server_Name macro to the
  102. serv_def.h file.  In this case, enter
  103.  
  104.              #define Server_Name "example"
  105.  
  106.  
  107. 7.  Building Client & Server
  108.  
  109. Procedures are included for building the example program.
  110. These procedures assume that your environment is set up as
  111. follows:
  112.  
  113.    - The PATH environment variable must specify the location
  114.      of the RPC Compiler executable files.
  115.  
  116.    - The LIB environment variable must specify the location
  117.      of the RPC runtime libraries.
  118.  
  119.    - The INCLUDE environment variable must specify the
  120.      location of the RPC .h include files.
  121.  
  122.    - The PDUDIR environment variable must specify the
  123.      location of the RPC .rpc files.
  124.  
  125.    - The RPCSCP environment variable must specify the
  126.      location of the RPC server control procedures.
  127.  
  128. The PATH, LIB, and INCLUDE environment variables should be
  129. set in your autoexec.bat file by modifying their current
  130. definitions. The PDUDIR and RPCSCP environment variables can
  131. be set in your autoexec.bat file, or in a local .bat file,
  132. or directly with the "set" command.
  133.  
  134. Since a distributed application runs on two machines, you
  135. must install an executable version of the client or server
  136. on another machine.  If the two machines are identical, you
  137. can build both executables (the client and server) on one
  138. machine and then move one of the executables.  However, if
  139. the two machines are not identical, you must follow the
  140. directions on the other machine for running this example and
  141. build one of the executable programs there (note that the
  142. executable filenames may differ across products).
  143.  
  144. Note that with the Microsoft C Compiler and utilities,
  145. numerous warnings will be generated when executing the
  146. makefiles. For example, you may see a "target does not
  147. exist" or "module not in library" warning. These simply mean
  148. that the file the makefile is currently creating does not
  149. yet exist. Generally, all warnings may be ignored.
  150.  
  151. To build the example program, you simply execute the build
  152. procedures in each subdirectory as follows:
  153.  
  154.   1.  Change to the client directory (client) and build the
  155.       client:
  156.  
  157.            make client.mk
  158.  
  159.   2.  Change to the server directory (server) and build the
  160.       server:
  161.  
  162.            make server.mk
  163.  
  164.  
  165.  
  166.  
  167.  
  168. 8.  Running the Distributed Application
  169.  
  170. The server program should be started before the client
  171. program is run.
  172.  
  173. To run the example on two machines, proceed as follows:
  174.  
  175.   1.  Change to the server directory (server) on the machine
  176.       running the server and start the server:
  177.  
  178.            server
  179.  
  180.   2.  Change to the client directory (client) on the machine
  181.       running the client and start the client:
  182.  
  183.            client
  184.  
  185.  
  186.  
  187.  
  188.  
  189. 9.  Description
  190.  
  191. This example is to be used in conjunction with the
  192. Quickstart Guide.  It is provided for the user who wants to
  193. learn the basic steps required to transform a single-machine
  194. application into a distributed application that runs on two
  195. or more networked computers.
  196.  
  197.  
  198. 10.  Problems Completing this Example
  199.  
  200. If your Quick Start application builds but doesn't give the
  201. same results as the 'stdalone' application, check that the
  202. server is running.  Because there is no error checking (see
  203. Standard Error Handling in the Quick Start Manual for how to
  204. implement error checking), if your client cannot connect to
  205. the server no error will be reported and the results of this
  206. example will be returned as zero.
  207.  
  208. The server may take some time to register.  Wait a short
  209. period and try running your client again.
  210.  
  211. It is possible that the server failed because someone else
  212. is running the quick example or another example on the same
  213. network.  All of our examples are built to register with the
  214. same server name and once that name has been registered, no
  215. other program may use it.
  216.  
  217. The solution is simple:  change the server name for your
  218. application to a unique server name.  This will prevent two
  219. or more users from invoking a server process using the same
  220. server name.  Choose a server name not likely to be selected
  221. by someone else.  For example, use your user or login name.
  222.  
  223. The server name must be changed in both the client and the
  224. server, and the SAME name must be used.
  225.  
  226. If you had other problems creating this example, refer to
  227. another example program called nonper that uses the same
  228. application.  The nonper example basically serves as a
  229. solution set for the quick example.
  230.