Class EmulatedNodeServer

java.lang.Object
  extended byjava.lang.Thread
      extended byEmulatedNodeServer
All Implemented Interfaces:
java.lang.Runnable

public class EmulatedNodeServer
extends java.lang.Thread

   
 In a seperate thread, this class listens to incoming messages from neighbors and stores the data received
 


Field Summary
static int ID
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EmulatedNodeServer(java.net.DatagramSocket socket, MultiplexIO multiplexIO)
          Creates a new EmulatedNodeServer
 
Method Summary
 java.net.DatagramPacket getPacket()
          Gets the first packet stored
 boolean hasPackets()
          Tests if there are more packets stored
 void run()
          This starts the server
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final int ID
See Also:
Constant Field Values
Constructor Detail

EmulatedNodeServer

public EmulatedNodeServer(java.net.DatagramSocket socket,
                          MultiplexIO multiplexIO)
Creates a new EmulatedNodeServer

Parameters:
socket - The UDP socket to listen on
Method Detail

run

public void run()
This starts the server


hasPackets

public boolean hasPackets()
Tests if there are more packets stored

Returns:
True if there are more packets stored in memory

getPacket

public java.net.DatagramPacket getPacket()
Gets the first packet stored

Returns:
The first packet stored