java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.TerminationBlock
Enclosing class:
SSU2Payload

public static class SSU2Payload.TerminationBlockextends SSU2Payload.Block
Block containing session termination data. Used to signal session termination.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final long
    Count of messages received, if known.
    private final byte
    The termination reason number.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TerminationBlock(int reason, long lastReceived)
    Create a session termination block.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    int
    Return the 9 byte termination data length.
    int
    writeData(byte[] tgt, int off)
    Write the termination block data to the target array.

    Methods inherited from class SSU2Payload.Block

    getTotalLength, getType, toString, write
    Modifier and Type
    Method
    Description
    int
    Return the total size of the block, including the 3 byte header.
    int
    The block type.
    String representation of this block.
    int
    write(byte[] tgt, int off)
    Write the block to the target array, returning the new offset.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • rsn

      private final byte rsn
      The termination reason number.
    • rcvd

      private final long rcvd
      Count of messages received, if known.
  • Constructor Details

    • TerminationBlock

      public TerminationBlock(int reason, long lastReceived)
      Create a session termination block.
      Parameters:
      reason - termination reason code (0-255)
      lastReceived - highest sequence number received
  • Method Details

    • getDataLength

      public int getDataLength()
      Return the 9 byte termination data length.
      Specified by:
      getDataLength in class SSU2Payload.Block
      Returns:
      the data length
    • writeData

      public int writeData(byte[] tgt, int off)
      Write the termination block data to the target array.
      Specified by:
      writeData in class SSU2Payload.Block
      Parameters:
      tgt - target array to write to
      off - offset in the target array
      Returns:
      the new offset after writing