All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.nodeos.UdpBuffer
java.lang.Object
   |
   +----edu.utah.janos.nodeos.Buffer
           |
           +----edu.utah.janos.nodeos.UdpBuffer

  Summary

class  UdpBuffer
     extends edu.utah.janos.nodeos.Buffer
{
          // Fields 13
     static final int MAX_PACKET_LEN;
     private static int absMaxUsedBuffers;
     private static int availableBuffers;
     private static final float decayOffset;
     static UdpBuffer freeList;
     private int len;
     private static final float maxUseDecay;
     private static int maxUsedBuffers;
     UdpBuffer nextFree;
     private FlowState state;
     private static int totalBuffers;
     private final DatagramPacket udpPacket;
     private static int usedBuffers;

          // Constructors 1
     private UdpBuffer();

          // Methods 14
     static int absMaxUsedBuffers();
     static synchronized void addBuffers(int);
     private static synchronized void addToFreeList(UdpBuffer);
     static int availableBuffers();
     static synchronized UdpBuffer getFree();
     static int maxUsedBuffers();
     static synchronized void remBuffers(int);
     static int totalBuffers();
     static int usedBuffers();

     boolean charge(FlowState);
     private void credit(FlowState);
     int length();
     void receive(DatagramSocket) throws IOException;
     void recycle();

          // Inner Classes 1
     private static class UdpBuffer.UdpBufferInfo
}

A UDP implementation of Buffer.

Author:
Janos Ministry of Development


  Cross Reference

Returned By:
UdpBuffer.getFree()





  Fields

· freeList

Summary  |  Top
   static UdpBuffer freeList


· MAX_PACKET_LEN

Summary  |  Top
   static final int MAX_PACKET_LEN


· usedBuffers

Summary  |  Top
   private static int usedBuffers


· maxUsedBuffers

Summary  |  Top
   private static int maxUsedBuffers


· absMaxUsedBuffers

Summary  |  Top
   private static int absMaxUsedBuffers


· availableBuffers

Summary  |  Top
   private static int availableBuffers


· totalBuffers

Summary  |  Top
   private static int totalBuffers


· maxUseDecay

Summary  |  Top
   private static final float maxUseDecay


· decayOffset

Summary  |  Top
   private static final float decayOffset


· udpPacket

Summary  |  Top
   private final DatagramPacket udpPacket


· nextFree

Summary  |  Top
   UdpBuffer nextFree


· state

Summary  |  Top
   private FlowState state


· len

Summary  |  Top
   private int len


  Constructors

· UdpBuffer

Summary  |  Top

   private UdpBuffer() 

UdpBuffers can only be allocated by addBuffers()

Each UdpBuffer is MAX_PACKET_LEN bytes big.

See Also: addBuffers



  Methods

· addBuffers

Summary  |  Top
   static synchronized void addBuffers(int numBuffers) 

Add a bunch of buffers to the free buffer queue.



· remBuffers

Summary  |  Top
   static synchronized void remBuffers(int numBuffers) 

Remove a bunch of buffers from the free buffer queue



· getFree

Summary  |  Top
   static synchronized UdpBuffer getFree() 

Get the next available UdpBuffer.

Returns null if no buffers are available.



· charge

Summary  |  Top
   boolean charge(FlowState state) 

Charge the given flow for this buffer. This buffer will be associated with the flow (via this.state).

Returns true if the given flow can pay for this buffer.

Overrides:
charge in class Buffer


· credit

Summary  |  Top
   private void credit(FlowState state) 

Credit the flow associated with this buffer.



· recycle

Summary  |  Top
   void recycle() 

Put this buffer back in the recycle list (we're done with it).

Overrides:
recycle in class Buffer


· addToFreeList

Summary  |  Top
   private static synchronized void addToFreeList(UdpBuffer b) 

Add the given flow to this global free list.



· receive

Summary  |  Top
   void receive(DatagramSocket socket)  throws IOException


· length

Summary  |  Top
   int length() 


· usedBuffers

Summary  |  Top
   static int usedBuffers() 


· maxUsedBuffers

Summary  |  Top
   static int maxUsedBuffers() 


· absMaxUsedBuffers

Summary  |  Top
   static int absMaxUsedBuffers() 


· availableBuffers

Summary  |  Top
   static int availableBuffers() 


· totalBuffers

Summary  |  Top
   static int totalBuffers() 


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