Steps to follow on the blaze
box (Solaris):
Assumption: the file name is
hello.x replace hello with whatever the
.x filename is.
Step1: create a new directory and move to the new
directory.
Step2: Copy the .x file into the new directory
Step3: run UNIX cmd: rpcgen -C -a hello.x
This will create server, client and their stub files.
It will also create a make file viz.
"makefile.hello".
Step4: Copy this makefile.hello to Makefile
Open the Makefile and add at the top the following line:
CC = gcc
(This is needed, as we are using GNU's CC compiler).
Step5: Run unix command: "make" at the
prompt
This
will compile all your files. Also it
will create two executable files viz. hello_server and hello_client.
Step6: Run "hello_server" at the unix
prompt. It will create a background executable
file.
You may see the process by typing the command: "ps
-ax | grep hello_server".
Step7: Run "hello_client localhost" at
the unix prompt. This will interact
with the hello_server using RPC.
The above steps are done
without making any changes into the hello_server.c
and hello_client.c files, as
rpc doesn't generate any application logic for
you. In order to put application logic on the
hello_server.c and
hello_client.c files, you
need to following further steps.
Step-8: Run the following command: "ps-ax |
grep hello_server". Note the
process-id and issue the following
command: "kill -9 <process_id>". Note, if the process
doesn't belong to you, it
will not kill the process, so do not worry if it may not belong to
you. As a student, you do not have permission to
kill the process.
Step-9: Edit hello_server.c file and add application
logic. Once you saved
this file. You can compile it using the command:
"make". This will compile and
display any
compilator errors and
warnings or successful completion.
Step-10: Edit hello_client.c
file and add application logic. Once
you saved
this file. Just run "make" command. It will also compile and issue
warnings/errors or
successful completion.
Step-11: Follow Step-6 and
Step-7.