Package org.drasyl.handler.connection
Class RetransmissionQueue
java.lang.Object
org.drasyl.handler.connection.RetransmissionQueue
Represents the retransmission queue that holds segments that need to be retransmitted due to
timeout or loss in a connection.
The retransmission queue is used by the sender to keep track of segments that have been sent but not yet acknowledged, and need to be retransmitted after a certain period of time due to timeout or loss in the network.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(io.netty.channel.ChannelHandlerContext ctx, Segment seg, TransmissionControlBlock tcb) long
boolean
isEmpty()
Returnstrue
if this deque contains no elements.void
release()
boolean
removeAcknowledged
(io.netty.channel.ChannelHandlerContext ctx, TransmissionControlBlock tcb) int
size()
Returns the number of elements in this deque.toString()
-
Method Details
-
add
public void add(io.netty.channel.ChannelHandlerContext ctx, Segment seg, TransmissionControlBlock tcb) -
toString
-
removeAcknowledged
public boolean removeAcknowledged(io.netty.channel.ChannelHandlerContext ctx, TransmissionControlBlock tcb) -
release
public void release() -
firstSegmentSentTime
public long firstSegmentSentTime() -
size
public int size()Returns the number of elements in this deque.- Returns:
- the number of elements in this deque
-
isEmpty
public boolean isEmpty()Returnstrue
if this deque contains no elements.- Returns:
true
if this deque contains no elements
-