Network transmit queue limits
Posted Aug 12, 2011 17:25 UTC (Fri) by
ajb (subscriber, #9694)
In reply to:
Network transmit queue limits by dlang
Parent article:
Network transmit queue limits
I was thinking of something along the lines of:
void q_add(Q *q,PKT *pkt)
{
// timestamp packet
pkt->time=now();
// add packet to end of list
*q->last=pkt;
q->last=&pkt->next;
}
PKT *q_get(Q *q)
{
PKT *pkt=q->first;
if((pkt->time+q->max_time) < now())
{
free(pkt);
return 0;
}
else
{
return pkt;
}
}
No estimation at all. There are weaknesses in this approach, but it's simpler than adjusting a byte length.
(
Log in to post comments)