public abstract class PacketPool extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
PacketPool.PooledPacket |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_SIZE |
static int |
DEFAULT_POOL_SIZE |
| Constructor and Description |
|---|
PacketPool(int maxPackets) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Packet |
allocateNewPacket() |
void |
dispose() |
Packet |
getPacket()
Blocks until a ByteBuffer can be retreived from the pool.
|
void |
waitForPacketsToReturn() |
public static final int DEFAULT_POOL_SIZE
public static final int DEFAULT_PACKET_SIZE
public PacketPool(int maxPackets)
maxPackets - the number of buffers that will be in the pool.public Packet getPacket() throws InterruptedException
InterruptedExceptionpublic void dispose()
public void waitForPacketsToReturn()
protected abstract Packet allocateNewPacket()
Copyright © 2005–2019. All rights reserved.