edu.rit.m2mp
Class NullChannel

java.lang.Object
  extended by edu.rit.m2mp.Channel
      extended by edu.rit.m2mp.NullChannel

public class NullChannel
extends Channel

Class NullChannel provides an M2MP Channel implementation that does not send or receive messages. If the M2MP Layer should not communicate on an external network, configure the M2MP Layer to use a NullChannel.


Field Summary
 
Fields inherited from class edu.rit.m2mp.Channel
myPacketPool
 
Constructor Summary
NullChannel(PacketPool thePacketPool)
          Construct a new null 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

NullChannel

public NullChannel(PacketPool thePacketPool)
Construct a new null channel.

Parameters:
thePacketPool - Packet pool.
Throws:
NullPointerException - (unchecked exception) Thrown if thePacketPool is null.
Method Detail

receivePacket

public Packet receivePacket()
                     throws IOException
Receive an M2MP packet via this channel.

Specified by:
receivePacket in class Channel
Returns:
M2MP packet that was received.
Throws:
IOException - Thrown if an I/O error occurred.

transmitPacket

public void transmitPacket(Packet thePacket)
                    throws IOException
Send the given M2MP packet via this channel.

Specified by:
transmitPacket in class Channel
Parameters:
thePacket - M2MP packet to be sent.
Throws:
IOException - Thrown if an I/O error occurred.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.