java.lang.Object
net.i2p.client.streaming.impl.SchedulerImpl
net.i2p.client.streaming.impl.SchedulerPreconnect
- All Implemented Interfaces:
TaskScheduler
Scheduler used for locally created connections where we have not yet sent the initial SYN packet.
Entry conditions:
- Locally created
- No packets sent or received
Events:
- Message flush (explicitly, through a full buffer, or stream closure)
- Initial delay timeout (causing implicit flush of any data available)
Next states:
connecting- after sending a packet
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 locally created connections that haven't sent any packets yet.voideventOccurred(Connection con) Handle an event on a preconnect 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
SchedulerPreconnect
Passes the context on to the shared scheduler base.- Parameters:
ctx- the application context whose clock, logging and rate statistics the inherited scheduler uses for the connect delay timer
Method Details
accept
Accept locally created connections that haven't sent any packets yet.- Parameters:
con- the connection to check- Returns:
- true if the connection is in the preconnect state
eventOccurred
Handle an event on a preconnect connection. Sends the SYN when the connect delay has elapsed.- Parameters:
con- the connection that had an event