home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
r
/
rem-file.zip
/
remote_file
/
README
< prev
next >
Wrap
Text File
|
1992-08-20
|
6KB
|
198 lines
This directory contains the complete code for the remote_file application
shown in Appendix E of "Guide to Writing DCE Applications" by John Shirley,
published by O'Reilly & Associates, Inc. This application forms the basis for
the discussion of context handles in Chapter 7.
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 should be:
x remote_file/README, 5811 bytes, 12 tape blocks
x remote_file/Makefile, 1559 bytes, 4 tape blocks
x remote_file/r_client.c, 1761 bytes, 4 tape blocks
x remote_file/context_rundown.c, 455 bytes, 1 tape blocks
x remote_file/do_string_binding.c, 2772 bytes, 6 tape blocks
x remote_file/get_args.c, 986 bytes, 2 tape blocks
x remote_file/r_procedures.c, 1717 bytes, 4 tape blocks
x remote_file/r_server.c, 2672 bytes, 6 tape blocks
x remote_file/remote_file.idl, 767 bytes, 2 tape blocks
E
_________________________________________________________________
The Remote_file Application
The remote_file client copies ASCII data from the client to
the server. The source can be a data file or the standard
input of the client. The target on the server system is
either a file or the server standard output. The remote_
file application demonstrates some advanced features of DCE
application development including:
o Using a context handle with a context rundown procedure
o Using the explicit binding method with a primitive
binding handle
o Finding a server using strings of binding information
How to Run the Application
To run the local test of the application, use an ASCII text
file as input and a new data file as output. The host is
not relevant for the local test. Type the following:
C> make local
C> local_r_client.exe input host output
To run the server of the distributed application, type the
following:
S> make server
S> r_server.exe
To run the client of the distributed application to
transfer ASCII data, use an ASCII text file as input and
a new data file on the server host as output. Type the
following:
C> make client
C> r_client.exe input host output
The Remote_file Application E-1
The Remote_file Application
Application Files
Makefile contains descriptions of how the application is
compiled.
remote_file.idl contains descriptions of the data types and
procedures for the interface.
r_client.c interprets the user input by calling the
application-specific procedure get_args. A binding
handle representing the information about a client-
server relationship is obtained from strings of binding
information. The remote procedure remote_open is called
to open the server target file. A buffer is allocated
for a conformant array. The application loops, reading
source data and sending the data to the target with a
remote procedure call to remote_send. Finally, the remote
procedure remote_close is called to close the target file.
get_args.c interprets the user input to obtain the name of
a local client ASCII file of source data, the server host
to use, and the server target file.
do_string_binding.c contains the do_string_binding
procedure that shows how to find a server from strings
of binding information. A host name or network address is
input, and then combined with a generated protocol sequence
to create a valid binding handle, which is returned as a
parameter.
context_rundown.c is the implementation of a context
rundown procedure. The server stub calls this procedure
automatically if communication breaks between a client and
the server which is maintaining context for the client. For
this application, the context is a file handle of a server
data file. This context rundown procedure closes the file.
r_procedures.c is the implementation of the remote
procedures defined in the remote_file interface.
r_server.c initializes the server with a series of runtime
calls prior to servicing remote procedure calls. In
this application, all available protocol sequences are
registered. The server is not advertised in a name service
database. The server's dynamic endpoints are added to the
E-2 The Remote_file Application
The Remote_file Application
server's local endpoint map. A client finds this server
by constructing a string binding containing a protocol
sequence and the host name or network address.
The Remote_file Application E-3