All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.core.InChannel
java.lang.Object
   |
   +----edu.utah.janos.core.InChannel

  Summary

public final class  InChannel
     extends java.lang.Object
{
          // Fields 6
     private final DemultiplexKey classifier;
     private static final Vector classifierTable;
     private final DeliverFunc deliverFunc;
     public static final byte[] exitPacket;
     final Flow flow;
     private final ThreadPool threadPool;

          // Constructors 1
     public InChannel(Flow, DemultiplexKey, ThreadPool, DeliverFunc);

          // Methods 6
     private static void addClassifier(InChannel);
     static boolean demultiplex(UdpBuffer);
     static String[] getPacketClassifierMap();
     public static void msgLoop(Address) throws IOException;
     public static void msgLoop(int) throws IOException;

     boolean scheduleDelivery(Buffer, int, int, int);
}

Java wrapper for an InChannel.

Implemented on top of UDP for the moment.

See Also: CutThroughChannel, OutChannel


  Cross Reference

Returned By:
UdpTest.makeInChannel()





  Fields

· exitPacket

Summary  |  Top
   public static final byte[] exitPacket

Death Packet. XXX.


· classifierTable

Summary  |  Top
   private static final Vector classifierTable

This is a kernel-global variable. It maps Demultiplex keys to InChannels. XXX global variable


· flow

Summary  |  Top
   final Flow flow

The flow this receive channel is associated with.


· classifier

Summary  |  Top
   private final DemultiplexKey classifier

The demultiplex key associated with this channel.


· threadPool

Summary  |  Top
   private final ThreadPool threadPool

The ThreadPool to send incoming packets to. ThreadPool.addWork() had best be protected kernel code (i.e., final).


· deliverFunc

Summary  |  Top
   private final DeliverFunc deliverFunc

The callback for delivery.


  Constructors

· InChannel

Summary  |  Top

   public InChannel(Flow flow, 
                    DemultiplexKey classifier, 
                    ThreadPool threadPool, 
                    DeliverFunc deliverFunc) 


  Methods

· addClassifier

Summary  |  Top
   private static void addClassifier(InChannel newChan) 


· getPacketClassifierMap

Summary  |  Top
   static String[] getPacketClassifierMap() 

Only invoked by Status.



· msgLoop

Summary  |  Top
   public static void msgLoop(Address localAddr)  throws IOException

XXX

See Also: msgLoop



· msgLoop

Summary  |  Top
   public static void msgLoop(int recvPort)  throws IOException

This must be run before any Channel objects are created.

XXX: shouldn't really be public



· demultiplex

Summary  |  Top
   static boolean demultiplex(UdpBuffer b) 

I sure hope this gets better

XXX I broke this. The return value is true if the packet was dispatched *and* the target had enough resources to handle the packet. It returns false if the packet wasn't matched *or* it was matched but the target didn't have enough resources.



· scheduleDelivery

Summary  |  Top
   boolean scheduleDelivery(Buffer b, 
                            int packetStart, 
                            int packetLength, 
                            int payloadStart) 

Schedule the given buffer b for delivery to this InChannel. A BufferHandle wrapping the packet is set up (from packetStart to packetLength). The payloadStart parameter is just a *hint* passed to the delivery function. To be meaningful, it should be relative to the packetStart.

Called by demultiplex (above) and by InChannelHandle.push().

Returns:
true if the buffer was scheduled, false if the target had insuffient resources.


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7