This directory contains the complete code for the arithmetic application shown in Appendix C of "Guide to Writing DCE Applications," 2nd edition, by John Shirley, Wei Hu, and David Magid, published by O'Reilly & Associates, Inc. This application provides a very simple, basic example of RPC programming for the introductory discussion in Chapter 1. A makefile is also included in this directory. You will probably have to change the libraries listed in the makefile, because the names and contents can vary from one vendor to another, and from one release to the next. The purpose of this application, and the RPC programming techniques that it illustrates, are covered in the book. The rest of this README file consists of directions for building and running the application, taken from the text of the appendix. The contents of this directory are: -rw-rw-r-- 1 1041 Jun 2 1992 Makefile -rw-rw-r-- 1 4457 Mar 11 10:21 README -rw-rw-r-- 1 827 Aug 20 1992 arithmetic.idl -rw-rw-r-- 1 712 Jun 2 1992 check_status.h -rw-rw-r-- 1 463 Aug 20 1992 client.c -rw-rw-r-- 1 81 Apr 16 1992 client.sh -rw-rw-r-- 1 471 Aug 20 1992 procedure.c -rw-rw-r-- 1 2719 Aug 20 1992 server.c -rw-rw-r-- 1 88 Apr 16 1992 server.sh C _________________________________________________________________ The Arithmetic Application The arithmetic application makes a remote procedure call to a procedure named sum_arrays. sum_arrays which adds together the values for the same array index in two long integer arrays, and returns the sums in another long integer array. The application demonstrates the basics of a distributed application with a remote procedure call and includes these features: o Defining a simple array in an interface definition. o Using the automatic binding method. o Exporting a server to the name service. o Checking the error status of RPC runtime calls. How to Run the Application To run the nondistributed local test of the application, type the following: C> make local C> local_client To run the server of the distributed application, set the application-specific environment variable ARITHMETIC_ SERVER_ENTRY to the server entry name /.:/arithmetic_ serverhost, where serverhost is the name of your server system. Type the following: S> make server S> setenv ARITHMETIC_SERVER_ENTRY /.:/arithmetic_serverhost S> server The Arithmetic Application C-1 The Arithmetic Application To run the client of the distributed application, set the RPC environment variable RPC_DEFAULT_ENTRY to the server entry name /.:/arithmetic_serverhost. The serverhost is the server host name, not the client host name. Type the following: C> make client C> setenv RPC_DEFAULT_ENTRY /.:/arithmetic_serverhost C> client Application Files Makefile contains descriptions of how the application is compiled. Use the compilation make all to create all the executable files for the application. client.sh is a shell script to set the environment and execute the client. server.sh is a shell script to set the environment and execute the server. arithmetic.idl contains the description of the constants, data types, and procedures for the interface. client.c initializes two arrays, calls the remote procedure sum_arrays, and displays the results of the returned array. procedure.c is the remote procedure implementation. server.c initializes the server with a series of RPC runtime calls. check_status.h defines the CHECK_STATUS macro which interprets error status codes that may return from RPC runtime calls. C-2 The Arithmetic Application