nachos.kernel.devices.test
Class NetworkTest
java.lang.Object
nachos.kernel.devices.test.NetworkTest
public class NetworkTest
- extends java.lang.Object
Class for testing the nachos network.
Two (or more) copies of nachos must be running, with machine ID's 0,
1, ... For example, with three copies of Nachos,
./run -d n -m 0 -nt 3 & ./run -d n -m 1 -nt 3 & ./run -d n -m 2 -nt 3 &
All the copies of nachos should be started at approximately the
same time (before the 5 second delay in the first machine's Network
constructor finishes); otherwise, messages may be lost. So, it's
convenient to use a single command-line to start all the copies of
nachos, as shown above. On the other hand, it's easier to see
what's going on if you run each nachos in a separate terminal
window (on the same computer).
When using the network, nachos never terminates automatically,
because it doesn't know whether it might receive another message.
It will terminate only if a user program calls Halt or if you
kill it externally (e.g., using the Unix or cygwin "kill" command,
or using Windows's Task Manager).
Field Summary |
private static byte |
me
network address of this nachos machine. |
private static byte |
numMach
number of nachos machines in the network, including this one. |
Method Summary |
static void |
start(java.lang.String[] args)
Entry point for the Network test. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numMach
private static byte numMach
- number of nachos machines in the network, including this one.
me
private static byte me
- network address of this nachos machine.
NetworkTest
public NetworkTest()
start
public static void start(java.lang.String[] args)
- Entry point for the Network test. If "-nt" is included in the
command-line arguments, then run the network test; otherwise, do
nothing.
The network test sends a greeting to each other machine, and
receives a greeting from each other machine.
- Parameters:
args
- Array containing command-line arguments