net.i2p.client.streaming.impl

## Class PacketQueue

- java.lang.Object
- - net.i2p.client.streaming.impl.PacketQueue

- All Implemented Interfaces:
    Closeable, AutoCloseable, SendMessageStatusListener

      class PacketQueue
      extends Object
      implements SendMessageStatusListener, Closeable

  Queue out packets to be sent through the session. Well, that's the theory at least... in practice we just send them immediately with no blocking, since the mode=bestEffort doesn't block in the SDK.

  MessageOutputStream -> ConnectionDataReceiver -> Connection -> PacketQueue -> I2PSession

- - ### Field Summary

    - ### Fields inherited from interface net.i2p.client.SendMessageStatusListener

      `STATUS_CANCELLED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PacketQueue(I2PAppContext context, SimpleTimer2 timer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Cannot be restarted.
    `boolean` | `enqueue(PacketLocal packet)` Add a new packet to be sent out ASAP.
    `void` | `messageStatus(I2PSession session, long msgId, int status)` SendMessageStatusListener interface Tell the client of an update in the send status for a message previously sent with I2PSession.sendMessage().

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PacketQueue

          public PacketQueue(I2PAppContext context,
                             SimpleTimer2 timer)

  - ### Method Detail

    - #### close

          public void close()

      Cannot be restarted.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`

    - #### enqueue

          public boolean enqueue(PacketLocal packet)

      Add a new packet to be sent out ASAP. This updates the acks. keys and tags disabled since dropped in I2PSession
      Returns:
        true if sent

    - #### messageStatus

          public void messageStatus(I2PSession session,
                                    long msgId,
                                    int status)

      SendMessageStatusListener interface Tell the client of an update in the send status for a message previously sent with I2PSession.sendMessage(). Multiple calls for a single message ID are possible.
      Specified by:
        `messageStatus` in interface `SendMessageStatusListener`
      Parameters:
        `session` - session notifying
        `msgId` - message number returned from a previous sendMessage() call
        `status` - of the message, as defined in MessageStatusMessage and this class.