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
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
- Returned By:
- UdpBuffer.getFree()
static UdpBuffer freeList
static final int MAX_PACKET_LEN
private static int usedBuffers
private static int maxUsedBuffers
private static int absMaxUsedBuffers
private static int availableBuffers
private static int totalBuffers
private static final float maxUseDecay
private static final float decayOffset
private final DatagramPacket udpPacket
UdpBuffer nextFree
private FlowState state
private int len
private UdpBuffer()
UdpBuffers can only be allocated by addBuffers()
Each UdpBuffer is MAX_PACKET_LEN bytes big.
See Also:
addBuffers
static synchronized void addBuffers(int numBuffers)
Add a bunch of buffers to the free buffer queue.
static synchronized void remBuffers(int numBuffers)
Remove a bunch of buffers from the free buffer queue
static synchronized UdpBuffer getFree()
Get the next available UdpBuffer.
Returns null if no buffers are available.
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
private void credit(FlowState state)
Credit the flow associated with this buffer.
void recycle()
Put this buffer back in the recycle list (we're
done with it).
- Overrides:
- recycle in class Buffer
private static synchronized void addToFreeList(UdpBuffer b)
Add the given flow to this global free list.
void receive(DatagramSocket socket) throws IOException
int length()
static int usedBuffers()
static int maxUsedBuffers()
static int absMaxUsedBuffers()
static int availableBuffers()
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