java.lang.Object
net.i2p.client.streaming.impl.SchedulerImpl
net.i2p.client.streaming.impl.SchedulerClosing
All Implemented Interfaces:
TaskScheduler

class SchedulerClosingextends SchedulerImpl

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:

  • closed - after both sending and receiving ACKs on the CLOSE
  • dead - after sending or receiving a RESET
  • Constructor Details

    • SchedulerClosing

      public SchedulerClosing(I2PAppContext ctx)
      Creates the closing-connection scheduler for the given application context.
      Parameters:
      ctx - application context supplying the transport and clock
  • Method Details

    • accept

      public boolean accept(Connection con)
      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

      public void eventOccurred(Connection con)
      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