aim4.sim
Class UdpListener

java.lang.Object
  extended by aim4.sim.UdpListener
All Implemented Interfaces:
Runnable

public class UdpListener
extends Object
implements Runnable

Listens for UDP datagrams from Marvin at a UPD port (default is 46000) for communication from real cars and manages corresponding proxyvehicle's.


Constructor Summary
UdpListener(int udpPort, Simulator sim)
          Constructor for a UDP listener on the specified port.
UdpListener(Simulator sim)
          Default constructor uses UDP port 46000
 
Method Summary
protected  void finalize()
          Finalize the class by closing the datagram sockets and delete the proxy vehicles.
 boolean hasStarted()
          Whether or not the thread has started to listen to the UDP port.
 void run()
          
 void start()
          Start the listener thread.
 void stop()
          Stop the listener thread.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UdpListener

public UdpListener(Simulator sim)
Default constructor uses UDP port 46000

Parameters:
sim - the simulator

UdpListener

public UdpListener(int udpPort,
                   Simulator sim)
Constructor for a UDP listener on the specified port.

Parameters:
udpPort - the port to listen on
sim - the simulator
Method Detail

finalize

protected void finalize()
                 throws Throwable
Finalize the class by closing the datagram sockets and delete the proxy vehicles.

Overrides:
finalize in class Object
Throws:
Throwable

hasStarted

public boolean hasStarted()
Whether or not the thread has started to listen to the UDP port.

Returns:
whether or not the thread has started to listen to the UDP port.

start

public void start()
Start the listener thread.


stop

public void stop()
Stop the listener thread.


run

public void run()

Specified by:
run in interface Runnable


Copyright © 2011. All Rights Reserved.