Class PacketLocal

    • Method Detail

      • setOptionalFrom

        public void setOptionalFrom()
        This sets the from field in the packet to the Destination for the session provided in the constructor. This also sets flag FLAG_FROM_INCLUDED. Also, as of 0.9.39, sets the offline signing data if supported by the session.
        Since:
        0.9.39 moved from super
      • setKeyUsed

        @Deprecated
        public void setKeyUsed​(SessionKey key)
        Deprecated.
        I2PSession throws out the tags
      • setTagsSent

        @Deprecated
        public void setTagsSent​(Set<SessionTag> tags)
        Deprecated.
        I2PSession throws out the tags
      • shouldSign

        public boolean shouldSign()
      • getCreatedOn

        public long getCreatedOn()
      • getLifetime

        public long getLifetime()
      • incrementSends

        public void incrementSends()
      • ackReceived

        public void ackReceived()
      • cancelled

        public void cancelled()
      • getAckTime

        public int getAckTime()
        how long after packet creation was it acked?
        Returns:
        how long after packet creation the packet was ACKed in ms
      • getNumSends

        public int getNumSends()
      • getLastSend

        public long getLastSend()
      • getConnection

        public Connection getConnection()
        Returns:
        null if not bound
      • incrementNACKs

        public void incrementNACKs()
        Will force a fast restransmit on the 3rd call (FAST_RETRANSMIT_THRESHOLD) but only if it's the lowest unacked (see Connection.ResendPacketEvent)
      • getNACKs

        public int getNACKs()
      • getTimeout

        public int getTimeout()
        Used by PacketQueue to feed an expiration to the router.
        Returns:
        time from now, not absolute time. May be zero if unset.
        Since:
        0.9.46
      • setTimeout

        public void setTimeout​(int timeout)
        Parameters:
        timeout - time from now, not absolute time
        Since:
        0.9.46
      • writeSignedPacket

        public int writeSignedPacket​(byte[] buffer,
                                     int offset)
                              throws IllegalStateException
        Sign and write the packet to the buffer (starting at the offset) and return the number of bytes written.
        Parameters:
        buffer - data to be written
        offset - starting point in the buffer
        Returns:
        Count of bytes written
        Throws:
        IllegalStateException - if there is data missing or otherwise b0rked
        Since:
        0.9.20 moved from Packet
      • logTCPDump

        public void logTCPDump()
        Generate a pcap/tcpdump-compatible format, so we can use standard debugging tools.