Class Port
java.lang.Object
|
+--Port
- public abstract class Port
- extends Object
Model of one port of a network device.
- Version:
- 2002-04-10
- Author:
- Max Hailperin
Field Summary |
static int |
ALL_HOSTS
special address (different from any Port's address)
used as a multicast destination for all Hosts |
static int |
ALL_LOCAL_BRIDGES
special address (different from any Port's address)
used as a multicast destination for all Bridges on
the local segment (that is, all Bridges that can be
reached without going through a Bridge -- packets
sent to this address are not to be forwarded by
Bridges) |
Constructor Summary |
Port()
|
Method Summary |
void |
connect(Port peer)
connects this Port to another Port, if this Port is disconnected |
void |
disconnect()
disconnects this Port from the other Port it is connected to, if any |
int |
getAddress()
returns this Port's address |
abstract void |
receive(Message m)
receives a Message from the connected Port; should be processed appropriately by this Port's device |
void |
transmit(Message m)
transmits a Message to the connected Port, if any |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALL_HOSTS
public static final int ALL_HOSTS
- special address (different from any Port's address)
used as a multicast destination for all Hosts
ALL_LOCAL_BRIDGES
public static final int ALL_LOCAL_BRIDGES
- special address (different from any Port's address)
used as a multicast destination for all Bridges on
the local segment (that is, all Bridges that can be
reached without going through a Bridge -- packets
sent to this address are not to be forwarded by
Bridges)
Port
public Port()
connect
public void connect(Port peer)
- connects this Port to another Port, if this Port is disconnected
- Parameters:
peer
- specifies the other Port to connect to
disconnect
public void disconnect()
- disconnects this Port from the other Port it is connected to, if any
getAddress
public int getAddress()
- returns this Port's address
- Returns:
- this Port's address
receive
public abstract void receive(Message m)
- receives a Message from the connected Port; should be processed appropriately by this Port's device
- Parameters:
m
- the Message being received
transmit
public void transmit(Message m)
- transmits a Message to the connected Port, if any
- Parameters:
m
- the Message to transmit
Generated by BlueJ