Up Previous Next

Recall the steps of testing: compile, run rmic, then start the server and the clients.

We can do that in three different ways (by contrast with sockets we can do it in only two different ways):

  1. We can move all the code to a machine, say: sluggo.cs.indiana.edu.

    We choose a free port and start the server on sluggo:

    java Server 18276
    We connect each client to the server:
    java Client sluggo.cs.indiana.edu 18276

  2. We can start the server on the localhost (same as above) then use 127.0.0.1 to connect clients to the server.
    java Client 127.0.0.1 18276
    (We assumed we pick the same number for the port).

  3. We can run the Setup.java program.

    This is, in fact, what differentiates our method (based on RMI) from what we can be done using sockets.

For development purposes we should use: 2, 3. (The first method listed is called: deployment.)

If we're not very familiar with the pattern presented here method 2 is definitely the safest (it enforces OOP, but not an API).


Up Previous Next