Drop the first packet instead of the last.
This commit is contained in:
parent
bb688bc896
commit
3355481bf8
@ -459,9 +459,14 @@ public class SinglePortUdpHarvester
|
|||||||
{
|
{
|
||||||
synchronized (queue)
|
synchronized (queue)
|
||||||
{
|
{
|
||||||
// XXX Should we drop the first packet from the queue instead?
|
// Drop the first rather than the current packet, so that
|
||||||
if (!queue.offer(buf))
|
// receivers can notice the loss earlier.
|
||||||
|
if (queue.size() == QUEUE_SIZE)
|
||||||
|
{
|
||||||
logger.info("Dropping a packet because the queue is full.");
|
logger.info("Dropping a packet because the queue is full.");
|
||||||
|
queue.poll();
|
||||||
|
}
|
||||||
|
queue.offer(buf);
|
||||||
|
|
||||||
queue.notifyAll();
|
queue.notifyAll();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user