java.lang.Object
net.i2p.client.streaming.impl.SchedulerImpl
net.i2p.client.streaming.impl.SchedulerClosing
- All Implemented Interfaces:
TaskScheduler
Scheduler used for after both SYNs have been ACKed and both sides have closed the stream, but either we haven't ACKed their close or they haven't ACKed ours.
Entry conditions:
- At least one side has initiated close.
- At least one direction has not ACKed the close.
Events:
- Packets received (which may or may not ACK the ones sent)
- RESET received
- Message sending fails (error talking to the session)
- Message sending fails (too many resends)
Next states:
Field Summary
Fields inherited from class SchedulerImpl
_context, _logModifier and TypeFieldDescriptionprotected final I2PAppContextApplication context the scheduled connections live in.protected final LogLogger scoped to this scheduler class.Constructor Summary
ConstructorsConstructorDescriptionCreates the closing-connection scheduler for the given application context.Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanaccept(Connection con) Accept connections where both sides have closed but at least one direction hasn't ACKed the close.voideventOccurred(Connection con) Handle an event on a closing connection.Methods inherited from class SchedulerImpl
reschedule, toStringModifier and TypeMethodDescriptionprotected voidreschedule(long msToWait, Connection con) Schedule a connection event to occur after the specified delay.toString()Name of the scheduler class.
Constructor Details
SchedulerClosing
Creates the closing-connection scheduler for the given application context.- Parameters:
ctx- application context supplying the transport and clock
Method Details
accept
Accept connections where both sides have closed but at least one direction hasn't ACKed the close.- Parameters:
con- the connection to check- Returns:
- true if the connection is in the closing state
eventOccurred
Handle an event on a closing connection. If there's data to send and the send delay has elapsed, send it. Otherwise reschedule.- Parameters:
con- the connection that had an event