Lab 1
-
Here are two implementation of the "time server" example
Mark had in class:
-
Please take a look at the code and try to understand it.
Ask questions!
-
Copy the content of both folders (including the make file) to your directory.
-
Compile the examples. You just have to run make for each
example. It would also be useful to take a look at the Makefile.
-
Run the examples.
-
Sockets example: Start the server on one machine and
the client on a different machine. The client will connect to the server;
read the time and print it out.
-
RMI example.
-
In client and server code replace buda.cs.uchicago.edu with
the machine you start the server on. Compile.
-
Start rmiregistry
-
On the machine you started rmiregistry start the server using:
-
java -Djava.rmi.server.codebase=file:///${HOME}/stuff/RMI_Example/
-Djava.security.policy=${HOME}/stuff/RMI_Example/policy TimeServerImpl
-
Note:
${HOME}/stuff/RMI_Example/
has to be replaced with the path to you code directory while
${HOME}/stuff/RMI_Example/policy has
to be replaced with the path to your policy file
-
On a different machine start the client with:
-
java -Djava.security.policy=${HOME}/stuff/RMI_Example/policy
Client
-
Work on the following lab assignment
-
Reminder: subscribe to the mailing list.