- All Implemented Interfaces:
TaskScheduler
Scheduler used once we've sent our SYN but it hasn't been ACKed yet. This connection may or may not be locally created.
Entry conditions:
- Packets sent but none ACKed
Events:
- Packets received (which may or may not ACK the ones sent)
- Message flush (explicitly, through a full buffer, or stream closure)
- Connection establishment timeout
- RESET received
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
ConstructorsConstructorDescriptionPasses the context on to the shared scheduler base.Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanaccept(Connection con) Accept connections where the SYN has been sent but not yet ACKed.voideventOccurred(Connection con) Handle an event on a connecting 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
SchedulerConnecting
Passes the context on to the shared scheduler base.- Parameters:
ctx- the I2P app context supplying the clock and logger
Method Details
accept
Accept connections where the SYN has been sent but not yet ACKed.- Parameters:
con- the connection to check- Returns:
- true if the connection is in the connecting state
eventOccurred
Handle an event on a connecting connection. Checks for connect timeout and sends available data when the send time arrives.The timeout gate uses the connection's effective connect window (
Connection.getEffectiveConnectWindow()) rather than the raw un-scaled connectTimeout. That window is the (connectDelay + connectTimeout) base scaled by the Tuner's connect-timeout multiplier, the same budgetwaitForConnect(int)and the SYN give-up check inConnection#getMaxSynSends()use, so this scheduler can never tear an unacknowledged SYN down before those render the accurate "Connection timed out: SYN not acknowledged" error. As a last-resort backstop it defers to an error that already fired and only sets its own generic message when none is present. A window of 0 means no connect timeout is configured, in which case this scheduler does not give up on its own.- Parameters:
con- the connection that had an event