|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.m2mp.Channel
edu.rit.m2mp.ControllableChannel
public class ControllableChannel
Class ControllableChannel provides a user-controllable channel in the Many-to-Many Protocol (M2MP). The M2MP Layer uses a channel to send messages to and receive messages from the external network. The edu.rit.m2mp.channel.class property in the M2MP properties file specifies the type of channel the M2MP Layer uses to communicate with the external network. If the edu.rit.m2mp.debug.controlpanel property is set to 1, the M2MP Layer interposes a ControllableChannel between itself and the external channel. (See class M2MPProperties for further information about the M2MP properties file.)
The ControllableChannel, if present, displays this UI:
The "Network" setting specifies whether the M2MP Layer is connected to the external network. If the "Connected" button is selected, the ControllableChannel passes all incoming and outgoing packets straight through; the M2MP Layer is connected to the external network. If the "Disconnected" button is selected, the ControllableChannel drops all incoming and outgoing packets; the M2MP Layer is disconnected from the external network. This can be used to simulate a network failure or network partition.
Field Summary |
---|
Fields inherited from class edu.rit.m2mp.Channel |
---|
myPacketPool |
Constructor Summary | |
---|---|
ControllableChannel(PacketPool thePacketPool,
Channel theChannel)
Construct a new controllable channel. |
Method Summary | |
---|---|
Packet |
receivePacket()
Receive an M2MP packet via this channel. |
void |
transmitPacket(Packet thePacket)
Send the given M2MP packet via this channel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ControllableChannel(PacketPool thePacketPool, Channel theChannel)
Packet
objects from the given
PacketPool
. The
controllable channels will pass packets through to and from the given
channel.
thePacketPool
- Packet pool.theChannel
- Underlying channel.
NullPointerException
- (unchecked exception) Thrown if thePacketPool is null or
theChannel is null.Method Detail |
---|
public Packet receivePacket() throws IOException
receivePacket
in class Channel
IOException
- Thrown if an I/O error occurred.public void transmitPacket(Packet thePacket) throws IOException
transmitPacket
in class Channel
thePacket
- M2MP packet to be sent.
IOException
- Thrown if an I/O error occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |