Now you have server defined in Segment 1026, compiled with
javac
and rmic
, and the client defined in
Segment 1028, compiled with javac
; you are ready to test
both.
First, on the server computer you open a window in which you start the
registry. If you use the code-testing registry program supplied by
Sun Microsystems, Inc., then you use the
rmiregistry
command:
rmiregistry
Next, on the server computer, you start the server program in another window:
java RatingServer Rating server connected to server
Then, with the server started, you can start the client stub in a window on the client computer:
java ClientStub The client is asking server, whitney.ai.mit.edu, for a rating The server, whitney.ai.mit.edu, returned 24
Plainly, the server has returned a result. Returning to the server window, you see that the client has come calling.
java RatingServer Rating server connected to server Rating server asked for rating
See the Software page at the end of this book for information on how to download a registry program.