net.i2p.client.streaming.impl

## Class ConnectionOptions

- java.lang.Object
- - net.i2p.client.streaming.impl.I2PSocketOptionsImpl
  - - net.i2p.client.streaming.impl.ConnectionOptions

- All Implemented Interfaces:
    I2PSocketOptions

      class ConnectionOptions
      extends I2PSocketOptionsImpl

  Define the current options for the con (and allow custom tweaking midstream) TODO many of these are not per-connection options, and should be migrated somewhere so they aren't copied for every connection

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_INITIAL_RTT` Initial RTT estimate for new connections before first measurement.
    `static int` | `DEFAULT_MAX_MESSAGE_SIZE` OK, here is the calculation on the message size to fit in a single tunnel message without fragmentation.
    `static int` | `DEFAULT_MAX_MESSAGE_SIZE_RATCHET` See analysis in proposal 144
    `(package private) static int` | `DEFAULT_MAX_SENDS`
    `static int` | `DEFAULT_TAG_THRESHOLD`
    `static int` | `DEFAULT_TAGS_TO_SEND`
    `static int` | `INACTIVITY_ACTION_DISCONNECT` on inactivity timeout, close the connection
    `static int` | `INACTIVITY_ACTION_NOOP` on inactivity timeout, do nothing
    `static int` | `INACTIVITY_ACTION_SEND` on inactivity timeout, send a payload message
    `(package private) static int` | `INITIAL_WINDOW_SIZE` RFC 6928 recommends 10 segments for better initial throughput.
    `static int` | `MIN_MESSAGE_SIZE`
    `(package private) static int` | `MIN_WINDOW_SIZE`
    `static String` | `PROP_ACCESS_LIST`
    `static String` | `PROP_ANSWER_PINGS`
    `static String` | `PROP_CONGESTION_AVOIDANCE_GROWTH_RATE_FACTOR`
    `static String` | `PROP_CONNECT_DELAY`
    `static String` | `PROP_DISABLE_REJ_LOG`
    `static String` | `PROP_ENABLE_ACCESS_LIST` all of these are @since 0.7.13
    `static String` | `PROP_ENABLE_BLACKLIST`
    `static String` | `PROP_ENFORCE_PROTO`
    `static String` | `PROP_INACTIVITY_ACTION`
    `static String` | `PROP_INACTIVITY_TIMEOUT`
    `static String` | `PROP_INITIAL_ACK_DELAY`
    `static String` | `PROP_INITIAL_RECEIVE_WINDOW` unused
    `static String` | `PROP_INITIAL_RESEND_DELAY`
    `static String` | `PROP_INITIAL_WINDOW_SIZE`
    `static String` | `PROP_LIMIT_ACTION`
    `static String` | `PROP_MAX_CONNS_DAY`
    `static String` | `PROP_MAX_CONNS_HOUR`
    `static String` | `PROP_MAX_CONNS_MIN` all of these are @since 0.7.14
    `static String` | `PROP_MAX_MESSAGE_SIZE`
    `static String` | `PROP_MAX_RESENDS`
    `static String` | `PROP_MAX_STREAMS` how many streams will we allow at once?
    `static String` | `PROP_MAX_TOTAL_CONNS_DAY`
    `static String` | `PROP_MAX_TOTAL_CONNS_HOUR`
    `static String` | `PROP_MAX_TOTAL_CONNS_MIN`
    `static String` | `PROP_MAX_WINDOW_SIZE`
    `static String` | `PROP_SLOW_START_GROWTH_RATE_FACTOR`
    `static String` | `PROP_TAG_THRESHOLD`
    `static String` | `PROP_TAGS_TO_SEND`

    - ### Fields inherited from class net.i2p.client.streaming.impl.I2PSocketOptionsImpl

      `DEFAULT_BUFFER_SIZE, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_WRITE_TIMEOUT`

    - ### Fields inherited from interface net.i2p.client.streaming.I2PSocketOptions

      `PROFILE_BULK, PROFILE_INTERACTIVE, PROP_BUFFER_SIZE, PROP_CONNECT_TIMEOUT, PROP_PROFILE, PROP_READ_TIMEOUT, PROP_WRITE_TIMEOUT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectionOptions()` Sets max buffer size, connect timeout, read timeout, and write timeout from System properties.
    `ConnectionOptions(ConnectionOptions opts)` Initializes from System properties then copies over all options.
    `ConnectionOptions(I2PSocketOptions opts)` Initializes from System properties then copies over all options.
    `ConnectionOptions(Properties opts)` Sets max buffer size, connect timeout, read timeout, and write timeout from properties.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) int` | `doubleRTO()` Double the RTO (after congestion).
    `Set<Hash>` | `getAccessList()`
    `boolean` | `getAnswerPings()` Do we respond to a ping?
    `Set<Hash>` | `getBlacklist()`
    `int` | `getCongestionAvoidanceGrowthRateFactor()` When we're in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor).
    `int` | `getConnectDelay()` how long will we wait after instantiating a new con before actually attempting to connect.
    `boolean` | `getDisableRejectLogging()` Do we disable connection rejected logging? Default false.
    `boolean` | `getEnforceProtocol()` Do we receive all traffic, or only traffic marked with I2PSession.PROTO_STREAMING (6) ? Default true.
    `int` | `getInactivityAction()`
    `int` | `getInactivityTimeout()` What period of inactivity qualifies as "too long"?
    `int` | `getInboundBufferSize()` What is the maximum size of the buffer used to accept data?
    `String` | `getLimitAction()` "reset", "drop", "http", or custom string.
    `int` | `getMaxConns()`
    `int` | `getMaxConnsPerDay()`
    `int` | `getMaxConnsPerHour()`
    `int` | `getMaxConnsPerMinute()` all of these are @since 0.7.14; no public setters
    `int` | `getMaxInitialMessageSize()` What is the largest message to send in the SYN from Alice to Bob?
    `int` | `getMaxMessageSize()` What is the largest message we want to send or receive?
    `int` | `getMaxPacketCount()` What is the maximum number of packets to buffer regardless of byte size? This provides a hybrid approach with both byte and packet limits.
    `int` | `getMaxResends()` How many times will we try to send a message before giving up?
    `int` | `getMaxTotalConnsPerDay()`
    `int` | `getMaxTotalConnsPerHour()`
    `int` | `getMaxTotalConnsPerMinute()`
    `int` | `getMaxWindowSize()`
    `int` | `getMinRTT()`
    `int` | `getProfile()` What profile do we want to use for this connection? TODO: Only bulk is supported so far.
    `boolean` | `getRequireFullySigned()` Do we want all packets in both directions to be signed, or can we deal with signatures on the SYN and FIN packets only? There is no property name defined for this, so it's safe to say this is unused and always false.
    `int` | `getResendDelay()` How long after sending a packet will we wait before resending?
    `int` | `getRTO()`
    `int` | `getRTT()` What to set the round trip time estimate to (in milliseconds)
    `(package private) int` | `getRTTDev()` used in TCB @since 0.9.8
    `int` | `getSendAckDelay()` if there are packets we haven't ACKed yet and we don't receive _receiveWindow messages before (_lastSendTime+_sendAckDelay), send an ACK of what we have received so far.
    `int` | `getSlowStartGrowthRateFactor()` When we're in slow start, we grow the window size at the rate of 1/(factor).
    `int` | `getTagsToSend()` This option is mostly handled on the router side, but PacketQueue also needs to know, so that when it overrides, it doesn't exceed the setting.
    `int` | `getTagThreshold()` This option is mostly handled on the router side, but PacketQueue also needs to know, so that when it overrides, it doesn't exceed the setting.
    `int` | `getWindowSize()` How many messages will we send before waiting for an ACK?
    `boolean` | `isAccessListEnabled()`
    `boolean` | `isBlacklistEnabled()`
    `(package private) void` | `loadFromCache(int rtt, int rttDev, int wdw)` Loads options from TCB cache.
    `boolean` | `receivedAck()`
    `void` | `setAnswerPings(boolean yes)`
    `void` | `setCongestionAvoidanceGrowthRateFactor(int factor)`
    `void` | `setConnectDelay(int delayMs)`
    `void` | `setDisableRejectLogging(boolean yes)`
    `void` | `setEnforceProtocol(boolean yes)`
    `void` | `setInactivityAction(int action)`
    `void` | `setInactivityTimeout(int timeout)`
    `void` | `setInboundBufferSize(int bytes)`
    `void` | `setMaxInitialMessageSize(int bytes)` What is the largest message to send in the SYN from Alice to Bob?
    `void` | `setMaxMessageSize(int bytes)`
    `void` | `setMaxResends(int numSends)`
    `void` | `setMaxWindowSize(int msgs)`
    `void` | `setProfile(int profile)` Set the profile for this connection.
    `void` | `setProperties(Properties opts)` Note: NOT part of the interface As of 0.9.19, defaults in opts are honored.
    `void` | `setReceiveWindow(int numMsgs)`
    `void` | `setRequireFullySigned(boolean sign)` unused, see above
    `void` | `setResendDelay(int ms)`
    `void` | `setSendAckDelay(int delayMs)` Unused except here, so expect the default initial delay of DEFAULT_INITIAL_ACK_DELAY unless set by the user to remain constant.
    `void` | `setSlowStartGrowthRateFactor(int factor)`
    `void` | `setWindowSize(int numMsgs)`
    `String` | `toString()` doesn't include everything
    `void` | `updateAll(ConnectionOptions opts)` Update everything by copying over from opts
    `void` | `updateRTT(int measuredValue)`

    - ### Methods inherited from class net.i2p.client.streaming.impl.I2PSocketOptionsImpl

      `getConnectTimeout, getDouble, getInt, getLocalPort, getMaxBufferSize, getPort, getReadTimeout, getWriteTimeout, init, setConnectTimeout, setLocalPort, setMaxBufferSize, setPort, setReadTimeout, setWriteTimeout`

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

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

- - ### Field Detail

    - #### DEFAULT_INITIAL_RTT

          public static final int DEFAULT_INITIAL_RTT

      Initial RTT estimate for new connections before first measurement. I2P typically has 2-10 second RTT, so 8 seconds provides a conservative starting point that adapts quickly via updateRTT().
      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_MESSAGE_SIZE

          public static final int DEFAULT_MAX_MESSAGE_SIZE

      OK, here is the calculation on the message size to fit in a single tunnel message without fragmentation. This is based on documentation, the code, and logging, however there are still some parts that could use more research.

            1024 Tunnel Message
            - 21 Header (see router/tunnel/BatchedPreprocessor.java)
           -----
            1003 Tunnel Payload
            - 39 Unfragmented instructions (see router/tunnel/TrivialPreprocessor.java)
           -----
             964 Garlic Message
            - 16 I2NP header
            -  4 length
           -----
             944 Garlic Message AES payload padded to 16 bytes
            -  0 Pad to 16 bytes
           -----
             944 Garlic Message (assumes no bundled leaseSet or keys)
            - 32 session tag
            -  2 tag count
            -  4 payload size
            - 32 payload hash
            -  1 flags
            -  1 clove count
            - 33 clove delivery instructions
                 (Tunnel Data Message goes here)
            -  4 clove ID
            -  8 clove expiration
            -  3 clove cert
            -  3 garlic cert
            -  4 garlic ID
            -  8 garlic expiration
           - 135 total overhead
           -----
             809 Data Message
            - 16 I2NP header
            -  4 length
           -----
             789 Gzipped I2NP message
            - 23 Gzip 10 byte header, 5 byte block header, 8 byte trailer (yes we always use gzip, but it
                 probably isn't really compressing, just adding the headers and trailer, since
                 HTTP Server already compresses, and most P2P files aren't compressible.
                 (see client/I2PSessionImpl2.java, util/ReusableGZipOutputStream.java, and the gzip and deflate specs)
           -----
             766
            - 28 Streaming header (22 min) and 6 bytes of options or nacks
           -----
             738 Streaming message size

           FOR TWO TUNNEL MESSAGES:

            2048 2 Tunnel Messages
            - 42 2 Headers
           -----
            2006 Tunnel Payload
            - 50 Fragmented instructions (43 for first + 7 for second)
           -----
            1956 Garlic Message
            - 16 I2NP header
            -  4 length
           -----
            1936 Garlic Message AES payload padded to 16 bytes
            1936
            -  0 Pad to 16 bytes
           -----
            1936 Garlic Message
            - 32 session tag
            -  2 tag count
            -  4 payload size
            - 32 payload hash
            -  1 flags
            -  1 clove count
            - 33 clove delivery instructions
                 (Tunnel Data Message goes here)
            -  4 clove ID
            -  8 clove expiration
            -  3 clove cert
            -  3 garlic cert
            -  4 garlic ID
            -  8 garlic expiration
           - 135 total overhead
           -----
            1801 Data Message
            - 16 I2NP header
            -  4 length
           -----
            1781 Gzipped I2NP message
            - 23 Gzip 10 byte header, 5 byte block header, 8 byte trailer
           -----
            1758
            - 28 Streaming header (22 min) and 6 bytes of options or nacks
           -----
            1730 Streaming message size to fit in 2 tunnel messages

           Similarly:
             3 msgs: 2722
             4 msgs: 3714

      Before release 0.6.1.14 this was 4096. From release 0.6.1.14 through release 0.6.4, this was 960. It was claimed in the comment that this fit in a single tunnel message (and the checkin comment says the goal was to increase reliability at the expense of throughput), clearly from the math above that was not correct. (Before 0.6.2, the reply leaseSet was bundled with every message, so it didn't even fit in TWO tunnel messages - more like 2 1/3)

      Now, it's not clear how often we will get the ideal situation (no reply leaseSet bundling, no key bundling, and especially not having a small message ahead of you, which will then cause fragmentation for all subsequent messages until the queue is emptied - BatchedPreprocessor doesn't do reordering, and it isn't clear to me if it could). In particular the initial messages in a new stream are much larger due to the leaseSet and key bundling. But for long-lived streams (like with i2psnark) this should pay dividends. The tunnel.batch* stats should provide some data for test comparisons.

      As MTU and MRU are identical and are negotiated to the lowest value for the two ends, you can't do widespread testing of a higher value. Unless we change to allow MTU and MRU to be different, which would be a pain because it would mess up our buffer scheme. Both 738 and 1730 have been tested to verify that the math above is correct. So let's try 1730 for release 0.6.5. This will allow for 738 testing as well, with i2p.streaming.maxMessageSize=738 (in configadvanced.jsp, or in i2ptunnel, or i2psnark, for example).

      Not that an isolated single packet is very common, but in this case, 960 was 113.3% total overhead. Compared to 738 (38.8% overhead) and 1730 (18.4%).

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_MESSAGE_SIZE_RATCHET

          public static final int DEFAULT_MAX_MESSAGE_SIZE_RATCHET

      See analysis in proposal 144
      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_SENDS

          static final int DEFAULT_MAX_SENDS

      See Also:
        Constant Field Values

    - #### DEFAULT_TAG_THRESHOLD

          public static final int DEFAULT_TAG_THRESHOLD

      See Also:
        Constant Field Values

    - #### DEFAULT_TAGS_TO_SEND

          public static final int DEFAULT_TAGS_TO_SEND

      See Also:
        Constant Field Values

    - #### INACTIVITY_ACTION_DISCONNECT

          public static final int INACTIVITY_ACTION_DISCONNECT

      on inactivity timeout, close the connection
      See Also:
        Constant Field Values

    - #### INACTIVITY_ACTION_NOOP

          public static final int INACTIVITY_ACTION_NOOP

      on inactivity timeout, do nothing
      See Also:
        Constant Field Values

    - #### INACTIVITY_ACTION_SEND

          public static final int INACTIVITY_ACTION_SEND

      on inactivity timeout, send a payload message
      See Also:
        Constant Field Values

    - #### INITIAL_WINDOW_SIZE

          static final int INITIAL_WINDOW_SIZE

      RFC 6928 recommends 10 segments for better initial throughput. Increased to 12 for I2P's high-latency environment to improve initial bandwidth utilization.
      See Also:
        Constant Field Values

    - #### MIN_MESSAGE_SIZE

          public static final int MIN_MESSAGE_SIZE

      See Also:
        Constant Field Values

    - #### MIN_WINDOW_SIZE

          static final int MIN_WINDOW_SIZE

      See Also:
        Constant Field Values

    - #### PROP_ACCESS_LIST

          public static final String PROP_ACCESS_LIST

      See Also:
        Constant Field Values

    - #### PROP_ANSWER_PINGS

          public static final String PROP_ANSWER_PINGS

      See Also:
        Constant Field Values

    - #### PROP_CONGESTION_AVOIDANCE_GROWTH_RATE_FACTOR

          public static final String PROP_CONGESTION_AVOIDANCE_GROWTH_RATE_FACTOR

      See Also:
        Constant Field Values

    - #### PROP_CONNECT_DELAY

          public static final String PROP_CONNECT_DELAY

      See Also:
        Constant Field Values

    - #### PROP_DISABLE_REJ_LOG

          public static final String PROP_DISABLE_REJ_LOG

      See Also:
        Constant Field Values

    - #### PROP_ENABLE_ACCESS_LIST

          public static final String PROP_ENABLE_ACCESS_LIST

      all of these are @since 0.7.13
      See Also:
        Constant Field Values

    - #### PROP_ENABLE_BLACKLIST

          public static final String PROP_ENABLE_BLACKLIST

      See Also:
        Constant Field Values

    - #### PROP_ENFORCE_PROTO

          public static final String PROP_ENFORCE_PROTO

      See Also:
        Constant Field Values

    - #### PROP_INACTIVITY_ACTION

          public static final String PROP_INACTIVITY_ACTION

      See Also:
        Constant Field Values

    - #### PROP_INACTIVITY_TIMEOUT

          public static final String PROP_INACTIVITY_TIMEOUT

      See Also:
        Constant Field Values

    - #### PROP_INITIAL_ACK_DELAY

          public static final String PROP_INITIAL_ACK_DELAY

      See Also:
        Constant Field Values

    - #### PROP_INITIAL_RECEIVE_WINDOW

          public static final String PROP_INITIAL_RECEIVE_WINDOW

      unused
      See Also:
        Constant Field Values

    - #### PROP_INITIAL_RESEND_DELAY

          public static final String PROP_INITIAL_RESEND_DELAY

      See Also:
        Constant Field Values

    - #### PROP_INITIAL_WINDOW_SIZE

          public static final String PROP_INITIAL_WINDOW_SIZE

      See Also:
        Constant Field Values

    - #### PROP_LIMIT_ACTION

          public static final String PROP_LIMIT_ACTION

      See Also:
        Constant Field Values

    - #### PROP_MAX_CONNS_DAY

          public static final String PROP_MAX_CONNS_DAY

      See Also:
        Constant Field Values

    - #### PROP_MAX_CONNS_HOUR

          public static final String PROP_MAX_CONNS_HOUR

      See Also:
        Constant Field Values

    - #### PROP_MAX_CONNS_MIN

          public static final String PROP_MAX_CONNS_MIN

      all of these are @since 0.7.14
      See Also:
        Constant Field Values

    - #### PROP_MAX_MESSAGE_SIZE

          public static final String PROP_MAX_MESSAGE_SIZE

      See Also:
        Constant Field Values

    - #### PROP_MAX_RESENDS

          public static final String PROP_MAX_RESENDS

      See Also:
        Constant Field Values

    - #### PROP_MAX_STREAMS

          public static final String PROP_MAX_STREAMS

      how many streams will we allow at once?
      See Also:
        Constant Field Values

    - #### PROP_MAX_TOTAL_CONNS_DAY

          public static final String PROP_MAX_TOTAL_CONNS_DAY

      See Also:
        Constant Field Values

    - #### PROP_MAX_TOTAL_CONNS_HOUR

          public static final String PROP_MAX_TOTAL_CONNS_HOUR

      See Also:
        Constant Field Values

    - #### PROP_MAX_TOTAL_CONNS_MIN

          public static final String PROP_MAX_TOTAL_CONNS_MIN

      See Also:
        Constant Field Values

    - #### PROP_MAX_WINDOW_SIZE

          public static final String PROP_MAX_WINDOW_SIZE

      See Also:
        Constant Field Values

    - #### PROP_SLOW_START_GROWTH_RATE_FACTOR

          public static final String PROP_SLOW_START_GROWTH_RATE_FACTOR

      See Also:
        Constant Field Values

    - #### PROP_TAG_THRESHOLD

          public static final String PROP_TAG_THRESHOLD

      See Also:
        Constant Field Values

    - #### PROP_TAGS_TO_SEND

          public static final String PROP_TAGS_TO_SEND

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConnectionOptions

          public ConnectionOptions()

      Sets max buffer size, connect timeout, read timeout, and write timeout from System properties. Does not set local port or remote port.

    - #### ConnectionOptions

          public ConnectionOptions(ConnectionOptions opts)

      Initializes from System properties then copies over all options.
      Parameters:
        `opts` - may be null

    - #### ConnectionOptions

          public ConnectionOptions(I2PSocketOptions opts)

      Initializes from System properties then copies over all options.
      Parameters:
        `opts` - may be null

    - #### ConnectionOptions

          public ConnectionOptions(Properties opts)

      Sets max buffer size, connect timeout, read timeout, and write timeout from properties. Does not set local port or remote port. As of 0.9.19, defaults in opts are honored.
      Parameters:
        `opts` - may be null

  - ### Method Detail

    - #### doubleRTO

          int doubleRTO()

      Double the RTO (after congestion). See RFC 6298 section 5 item 5.5
      Returns:
        new value, Connection.MIN_RESEND_DELAY to Connection.MAX_RESEND_DELAY

    - #### getAccessList

          public Set<Hash> getAccessList()

    - #### getAnswerPings

          public boolean getAnswerPings()

      Do we respond to a ping?
      Returns:
        if we do

    - #### getBlacklist

          public Set<Hash> getBlacklist()

    - #### getCongestionAvoidanceGrowthRateFactor

          public int getCongestionAvoidanceGrowthRateFactor()

      When we're in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages, so setting factor=maxMessageSize mimics TCP, but using a smaller factor helps grow a little more rapidly.
      Returns:
        window size to grow by to attempt to avoid congestion.

    - #### getConnectDelay

          public int getConnectDelay()

      how long will we wait after instantiating a new con before actually attempting to connect. If this is set to 0, connect ASAP. If it is greater than 0, wait until the output stream is flushed, the buffer fills, or that many milliseconds pass.
      Returns:
        how long to wait before actually attempting to connect

    - #### getDisableRejectLogging

          public boolean getDisableRejectLogging()

      Do we disable connection rejected logging? Default false.
      Returns:
        if we do

    - #### getEnforceProtocol

          public boolean getEnforceProtocol()

      Do we receive all traffic, or only traffic marked with I2PSession.PROTO_STREAMING (6) ? Default true. If PROTO is enforced, we cannot communicate with destinations earlier than version 0.7.1 (released March 2009), which is when streaming started sending the PROTO_STREAMING indication. Set to true if you are running multiple protocols on a single Destination.
      Returns:
        if we do

    - #### getInactivityAction

          public int getInactivityAction()

    - #### getInactivityTimeout

          public int getInactivityTimeout()

      What period of inactivity qualifies as "too long"?
      Returns:
        period of inactivity qualifies as "too long"

    - #### getInboundBufferSize

          public int getInboundBufferSize()

      What is the maximum size of the buffer used to accept data?
      Returns:
        size of the buffer used to accept data

    - #### getLimitAction

          public String getLimitAction()

      "reset", "drop", "http", or custom string. Default "reset".

    - #### getMaxConns

          public int getMaxConns()

    - #### getMaxConnsPerDay

          public int getMaxConnsPerDay()

    - #### getMaxConnsPerHour

          public int getMaxConnsPerHour()

    - #### getMaxConnsPerMinute

          public int getMaxConnsPerMinute()

      all of these are @since 0.7.14; no public setters

    - #### getMaxInitialMessageSize

          public int getMaxInitialMessageSize()

      What is the largest message to send in the SYN from Alice to Bob?
      Returns:
        the max

    - #### getMaxMessageSize

          public int getMaxMessageSize()

      What is the largest message we want to send or receive?
      Returns:
        Maximum message size (MTU/MRU)

    - #### getMaxPacketCount

          public int getMaxPacketCount()

      What is the maximum number of packets to buffer regardless of byte size? This provides a hybrid approach with both byte and packet limits.
      Returns:
        maximum number of packets to buffer

    - #### getMaxResends

          public int getMaxResends()

      How many times will we try to send a message before giving up?
      Returns:
        Maximum retrys before failing a sent message.

    - #### getMaxTotalConnsPerDay

          public int getMaxTotalConnsPerDay()

    - #### getMaxTotalConnsPerHour

          public int getMaxTotalConnsPerHour()

    - #### getMaxTotalConnsPerMinute

          public int getMaxTotalConnsPerMinute()

    - #### getMaxWindowSize

          public int getMaxWindowSize()

    - #### getMinRTT

          public int getMinRTT()

      Returns:
        minimum RTT observed over the life of the connection, greater than zero

    - #### getProfile

          public int getProfile()

      What profile do we want to use for this connection? TODO: Only bulk is supported so far.
      Returns:
        the profile of the connection.

    - #### getRequireFullySigned

          public boolean getRequireFullySigned()

      Do we want all packets in both directions to be signed, or can we deal with signatures on the SYN and FIN packets only? There is no property name defined for this, so it's safe to say this is unused and always false.
      Returns:
        if we want signatures on all packets.

    - #### getResendDelay

          public int getResendDelay()

      How long after sending a packet will we wait before resending?
      Returns:
        delay for a retransmission in ms

    - #### getRTO

          public int getRTO()

      Returns:
        Connection.MIN_RESEND_DELAY to Connection.MAX_RESEND_DELAY

    - #### getRTT

          public int getRTT()

      What to set the round trip time estimate to (in milliseconds)
      Returns:
        round trip time estimate in ms

    - #### getRTTDev

          int getRTTDev()

      used in TCB @since 0.9.8

    - #### getSendAckDelay

          public int getSendAckDelay()

      if there are packets we haven't ACKed yet and we don't receive _receiveWindow messages before (_lastSendTime+_sendAckDelay), send an ACK of what we have received so far. Ref: RFC 5681 sec. 4.3, RFC 1122 sec. 4.2.3.3, ticket #2706
      Returns:
        ACK delay in ms

    - #### getSlowStartGrowthRateFactor

          public int getSlowStartGrowthRateFactor()

      When we're in slow start, we grow the window size at the rate of 1/(factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages, so setting factor=maxMessageSize mimics TCP, but using a smaller factor helps grow a little more rapidly.
      Returns:
        slow start window size to grow by to attempt to avoid sending many small packets.

    - #### getTagsToSend

          public int getTagsToSend()

      This option is mostly handled on the router side, but PacketQueue also needs to know, so that when it overrides, it doesn't exceed the setting.

    - #### getTagThreshold

          public int getTagThreshold()

      This option is mostly handled on the router side, but PacketQueue also needs to know, so that when it overrides, it doesn't exceed the setting.

    - #### getWindowSize

          public int getWindowSize()

      How many messages will we send before waiting for an ACK?
      Returns:
        Maximum amount of messages that can be in-flight

    - #### isAccessListEnabled

          public boolean isAccessListEnabled()

    - #### isBlacklistEnabled

          public boolean isBlacklistEnabled()

    - #### loadFromCache

          void loadFromCache(int rtt,
                             int rttDev,
                             int wdw)

      Loads options from TCB cache.

    - #### receivedAck

          public boolean receivedAck()

    - #### setAnswerPings

          public void setAnswerPings(boolean yes)

    - #### setCongestionAvoidanceGrowthRateFactor

          public void setCongestionAvoidanceGrowthRateFactor(int factor)

    - #### setConnectDelay

          public void setConnectDelay(int delayMs)

    - #### setDisableRejectLogging

          public void setDisableRejectLogging(boolean yes)

    - #### setEnforceProtocol

          public void setEnforceProtocol(boolean yes)

    - #### setInactivityAction

          public void setInactivityAction(int action)

    - #### setInactivityTimeout

          public void setInactivityTimeout(int timeout)

    - #### setInboundBufferSize

          public void setInboundBufferSize(int bytes)

    - #### setMaxInitialMessageSize

          public void setMaxInitialMessageSize(int bytes)

      What is the largest message to send in the SYN from Alice to Bob?

    - #### setMaxMessageSize

          public void setMaxMessageSize(int bytes)

    - #### setMaxResends

          public void setMaxResends(int numSends)

    - #### setMaxWindowSize

          public void setMaxWindowSize(int msgs)

    - #### setProfile

          public void setProfile(int profile)

      Set the profile for this connection. Through API 0.9.63, threw an IllegalArgumentException for any value !=1. As of API 0.9.64, all values are saved. Warning: unused.

    - #### setProperties

          public void setProperties(Properties opts)

      Note: NOT part of the interface As of 0.9.19, defaults in opts are honored.
      Overrides:
        `setProperties` in class `I2PSocketOptionsImpl`
      Parameters:
        `opts` - may be null

    - #### setReceiveWindow

          public void setReceiveWindow(int numMsgs)

    - #### setRequireFullySigned

          public void setRequireFullySigned(boolean sign)

      unused, see above

    - #### setResendDelay

          public void setResendDelay(int ms)

    - #### setSendAckDelay

          public void setSendAckDelay(int delayMs)

      Unused except here, so expect the default initial delay of DEFAULT_INITIAL_ACK_DELAY unless set by the user to remain constant. Changing the default is not recommended. Ref: RFC 5681 sec. 4.3, RFC 1122 sec. 4.2.3.3, ticket #2706

    - #### setSlowStartGrowthRateFactor

          public void setSlowStartGrowthRateFactor(int factor)

    - #### setWindowSize

          public void setWindowSize(int numMsgs)

    - #### toString

          public String toString()

      doesn't include everything
      Overrides:
        `toString` in class `Object`

    - #### updateAll

          public void updateAll(ConnectionOptions opts)

      Update everything by copying over from opts
      Parameters:
        `opts` - non-null

    - #### updateRTT

          public void updateRTT(int measuredValue)

      Parameters:
        `measuredValue` - must be positive