All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class AcmeNet.Util.PacketEchoServer

AcmeNet.Util.PacketEchoServer

public class PacketEchoServer
An object whose only purpose is to echo back packets that you send to it. This class might be useful for testing parts of AcmeNet.


Variable Index

 o ni
The NetworkInterface that this PacketEchoServer uses to send and receive packets.

Constructor Index

 o PacketEchoServer()
Create a PacketEchoServer, creating a new NetworkInterface for it to use.
 o PacketEchoServer(NetworkInterface)
Create a PacketEchoServer that will use an existing NetworkInterface.

Method Index

 o getAddress()
 o main(String[])
 o run()
Executed by a daemon thread.

Variables

 o ni
 protected NetworkInterface ni
The NetworkInterface that this PacketEchoServer uses to send and receive packets.

Constructors

 o PacketEchoServer
 public PacketEchoServer() throws InternalException
Create a PacketEchoServer, creating a new NetworkInterface for it to use.

Throws: InternalException
something weird went wrong
 o PacketEchoServer
 public PacketEchoServer(NetworkInterface n)
Create a PacketEchoServer that will use an existing NetworkInterface.

Parameters:
n - the NetworkInterface this PacketEchoServer should use

Methods

 o getAddress
 public NetAddress getAddress()
Returns:
the address of this PacketEchoServer
 o run
 public void run()
Executed by a daemon thread. Don't call this.

 o main
 public static void main(String argv[]) throws InternalException

All Packages  Class Hierarchy  This Package  Previous  Next  Index