net.i2p.client.streaming.impl
Class Connection.ResendPacketEvent
java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.client.streaming.impl.Connection.ResendPacketEvent
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- Connection
class Connection.ResendPacketEvent
- extends SimpleTimer2.TimedEvent
Coordinate the resends of a given packet
Method Summary |
long |
getNextSendTime()
|
boolean |
retransmit()
Retransmit the packet if we need to. |
void |
timeReached()
Simple interface for events to be queued up and notified on expiration
the time requested has been reached (this call should NOT block,
otherwise the whole SimpleTimer gets backed up) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Connection.ResendPacketEvent
public Connection.ResendPacketEvent(PacketLocal packet,
long delay)
getNextSendTime
public long getNextSendTime()
timeReached
public void timeReached()
- Description copied from class:
SimpleTimer2.TimedEvent
- Simple interface for events to be queued up and notified on expiration
the time requested has been reached (this call should NOT block,
otherwise the whole SimpleTimer gets backed up)
- Specified by:
timeReached
in class SimpleTimer2.TimedEvent
retransmit
public boolean retransmit()
- Retransmit the packet if we need to.
ackImmediately() above calls directly in here, so
we have to use forceReschedule() instead of schedule() below,
to prevent duplicates in the timer queue.
don't synchronize this, deadlock with ackPackets->ackReceived->SimpleTimer2.cancel
- Returns:
- true if the packet was sent, false if it was not