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 TypeMethodDescriptionvoidadd(io.netty.channel.ChannelHandlerContext ctx, Segment seg, TransmissionControlBlock tcb) longbooleanisEmpty()Returnstrueif this deque contains no elements.voidrelease()booleanremoveAcknowledged(io.netty.channel.ChannelHandlerContext ctx, TransmissionControlBlock tcb) intsize()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()Returnstrueif this deque contains no elements.- Returns:
trueif this deque contains no elements
-