java.lang.Object
net.i2p.router.transport.ntcp.NTCP2Payload.Block
net.i2p.router.transport.ntcp.NTCP2Payload.TerminationBlock
Enclosing class:
NTCP2Payload

public static class NTCP2Payload.TerminationBlockextends NTCP2Payload.Block
Block containing termination data.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final long
    When the message was received, per the sender.
    private final byte
    The termination reason sent in the payload.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TerminationBlock(int reason, long lastReceived)
    Records the termination reason code and the peer's received frame count.
  • Method Summary

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

    Methods inherited from class NTCP2Payload.Block

    getTotalLength, toString, write
    Modifier and Type
    Method
    Description
    int
    How many bytes the whole block occupies in a frame.
    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 sent in the payload.
    • rcvd

      private final long rcvd
      When the message was received, per the sender.
  • Constructor Details

    • TerminationBlock

      public TerminationBlock(int reason, long lastReceived)
      Records the termination reason code and the peer's received frame count.
      Parameters:
      reason - termination reason code (0-255)
      lastReceived - count of valid frames the peer has received from us
  • Method Details

    • getDataLength

      public int getDataLength()
      The data length of this block.
      Specified by:
      getDataLength in class NTCP2Payload.Block
      Returns:
      the data length
    • writeData

      public int writeData(byte[] tgt, int off)
      Write the block data to the target array.
      Specified by:
      writeData in class NTCP2Payload.Block
      Parameters:
      tgt - the destination array
      off - index in tgt to write the data at, past the 3-byte header
      Returns:
      the offset just past the written data