class ConnectionOptions extends I2PSocketOptionsImpl
Static fields with volatile and class-level setters (e.g.,
setInitialRTO(int), setMaxWindowSize(int)) are
globally shared and adjusted by the Tuner. Per-connection fields are
copied from these globals when a new Connection is created.
| Modifier and Type | Field and Description |
|---|---|
static int | DEFAULT_INITIAL_RTTInitial RTT estimate before first measurement. |
static int | DEFAULT_MAX_MESSAGE_SIZEDefault maximum streaming message payload size, derived from 2 tunnel messages |
static int | DEFAULT_MAX_MESSAGE_SIZE_RATCHETOverride max message size for ratcheted connections per proposal 144 @since 0.9.47 |
(package private) static int | DEFAULT_MAX_SENDSDefault maximum number of times a single message will be retransmitted |
static int | DEFAULT_TAG_THRESHOLD |
static int | DEFAULT_TAGS_TO_SEND |
(package private) static int | defaultInactivityTimeout |
static int | INACTIVITY_ACTION_DISCONNECTDisconnect the connection when inactivity timeout fires |
static int | INACTIVITY_ACTION_NOOPNo action taken when inactivity timeout fires |
static int | INACTIVITY_ACTION_SENDSend a keepalive when inactivity timeout fires |
(package private) static int | initialWindowSizeRFC 6928 recommends 10; increased to 16 for I2P's high-latency environment. |
(package private) static int | maxSlowStartWindow |
static int | MIN_MESSAGE_SIZEMinimum allowed message size |
(package private) static int | MIN_WINDOW_SIZEMinimum congestion window size (one message in flight) |
static String | PROP_ACCESS_LISTComma-separated list of allowed or blocked destination hashes |
static String | PROP_ANSWER_PINGSWhether to respond to ping messages |
static String | PROP_CONGESTION_AVOIDANCE_GROWTH_RATE_FACTORCongestion avoidance window growth rate factor |
static String | PROP_CONNECT_DELAYDelay before starting connection setup, in ms |
static String | PROP_DISABLE_REJ_LOG |
static String | PROP_ENABLE_ACCESS_LISTEnable destination access list filtering |
static String | PROP_ENABLE_BLACKLISTEnable destination blacklist filtering |
static String | PROP_INACTIVITY_ACTIONAction to take on inactivity timeout |
static String | PROP_INACTIVITY_TIMEOUTIdle time before inactivity action fires, in ms |
static String | PROP_INITIAL_ACK_DELAYInitial delay before sending an ACK, in ms |
static String | PROP_INITIAL_RESEND_DELAYInitial delay before retransmitting, in ms |
static String | PROP_INITIAL_WINDOW_SIZEInitial congestion window size (messages in flight) |
static String | PROP_LIMIT_ACTIONReset, drop, http, or custom string; default reset @since 0.9.34 |
static String | PROP_MAX_CONNS_DAYMax connections per day from a single peer |
static String | PROP_MAX_CONNS_HOURMax connections per hour from a single peer |
static String | PROP_MAX_CONNS_MINMax connections per minute from a single peer |
static String | PROP_MAX_MESSAGE_SIZEMaximum size of a streaming message, in bytes |
static String | PROP_MAX_RESENDSMaximum number of times a message is resent |
(package private) static String | PROP_MAX_RTOProp max rto. |
static String | PROP_MAX_STREAMS |
static String | PROP_MAX_TOTAL_CONNS_DAYMax total connections per day across all peers |
static String | PROP_MAX_TOTAL_CONNS_HOURMax total connections per hour across all peers |
static String | PROP_MAX_TOTAL_CONNS_MINMax total connections per minute across all peers |
static String | PROP_MAX_WINDOW_SIZEMaximum congestion window size |
static String | PROP_PASSIVE_FLUSH_DELAYPassive flush delay in ms for MessageOutputStream. |
(package private) static String | PROP_RTO_MULTIPLIERRTO multiplier as percentage (e.g. |
static String | PROP_SLOW_START_GROWTH_RATE_FACTORSlow start window growth rate factor |
static String | PROP_TAG_THRESHOLD |
static String | PROP_TAGS_TO_SEND |
DEFAULT_BUFFER_SIZE, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_WRITE_TIMEOUTPROFILE_BULK, PROFILE_INTERACTIVE, PROP_BUFFER_SIZE, PROP_CONNECT_TIMEOUT, PROP_PROFILE, PROP_READ_TIMEOUT, PROP_WRITE_TIMEOUT| Constructor and Description |
|---|
ConnectionOptions()Create options with default values from system properties |
ConnectionOptions(ConnectionOptions opts)Create options as a deep copy of the given ConnectionOptions,
applying system property defaults then overlaying all local fields |
ConnectionOptions(I2PSocketOptions opts)Create options as a copy of the given I2PSocketOptions,
then apply system property defaults for streaming-specific fields |
ConnectionOptions(Properties opts)Create options initialized from the given properties |
| Modifier and Type | Method and Description |
|---|---|
(package private) int | doubleRTO()Double RTO after congestion per RFC 6298 sec. |
Set<Hash> | getAccessList()Access list. |
boolean | getAnswerPings()Whether ping messages are answered. |
Set<Hash> | getBlacklist()Blacklist. |
int | getCongestionAvoidanceGrowthRateFactor()In congestion avoidance, window grows at 1/(windowSize*factor). |
int | getConnectDelay()Delay before starting the connection. |
static int | getDefaultCongestionAvoidanceGrowthRateFactorStatic()Default congestion avoidance growth rate factor. |
static int | getDefaultInactivityTimeout()Default inactivity timeout. |
static int | getDefaultInitialAckDelay()Default initial ACK delay. |
static int | getDefaultResendDelayStatic()Default resend delay. |
static int | getDefaultSlowStartGrowthRateFactorStatic()Default slow start growth rate factor. |
boolean | getDisableRejectLogging()Whether connection reject logging is suppressed. |
(package private) static int | getImmediateAckDelayStatic()Immediate ack delay static. |
int | getInactivityAction()Action taken when the inactivity timeout fires. |
int | getInactivityTimeout()Inactivity timeout before action in ms |
int | getInboundBufferSize()Inbound buffer size. |
(package private) static int | getInitialRTO()Initial rto. |
(package private) static int | getInitialWindowSize()Initial window size. |
String | getLimitAction()"reset", "drop", "http", or custom string; default "reset" @since 0.9.34 |
int | getMaxConns() |
int | getMaxConnsPerDay()Max connections per day. |
int | getMaxConnsPerHour()Max connections per hour. |
int | getMaxConnsPerMinute() |
static int | getMaxInboundBufferStatic() |
int | getMaxInitialMessageSize()Largest message to send in SYN @since 0.9.47 |
int | getMaxMessageSize()Maximum message size (MTU/MRU) |
int | getMaxPacketCount()Maximum packets to buffer regardless of byte size (hybrid byte+packet limit) |
static int | getMaxResendDelayStatic() |
int | getMaxResends()Maximum retries per message |
static int | getMaxRTOStatic() |
static int | getMaxRttStatic()Max RTT. |
(package private) static int | getMaxSlowStartWindowStatic()Max slow start window static. |
int | getMaxTotalConnsPerDay()Max total connections per day. |
int | getMaxTotalConnsPerHour()Max total connections per hour. |
int | getMaxTotalConnsPerMinute()Max total connections per minute. |
int | getMaxWindowSize()Maximum window size cap. |
static long | getMinPacingRate()Min pacing rate. |
static int | getMinPacingRateKBps() |
static int | getMinResendDelayStatic() |
int | getMinRTT()Minimum RTT observed, greater than zero |
int | getPassiveFlushDelay()Effective passive flush delay in ms. |
int | getProfile()Connection profile. |
boolean | getRequireFullySigned()Sign all packets or only SYN/FIN? Unused — no property exists, always false. |
int | getResendDelay()Delay before retransmitting a packet in ms |
int | getRTO()Retransmit timeout, clamped to [minResendDelay, maxResendDelay] |
(package private) static int | getRTOMultiplier() |
int | getRTT()Smoothed round-trip time estimate in ms |
(package private) int | getRTTDev()RTT deviation for RTO calculation |
int | getSendAckDelay()Delay before sending a forced ACK when no data packets arrive. |
int | getSlowStartGrowthRateFactor()In slow start, window grows at 1/factor. |
int | getTagsToSend()Mostly handled on router side; PacketQueue needs to know for override limits @since 0.9.34 |
int | getTagThreshold() |
int | getWindowSize()Messages in flight before waiting for ACK |
boolean | isAccessListEnabled()Whether the access list is enabled. |
boolean | isBlacklistEnabled()Whether the blacklist is enabled. |
(package private) void | loadFromCache(int rtt,
int rttDev,
int wdw)Load cached RTT/deviation/window from TCB and transition directly to STEADY state |
boolean | receivedAck()Has at least one ACK been received? |
void | setAnswerPings(boolean yes)Whether ping messages are answered. |
void | setCongestionAvoidanceGrowthRateFactor(int factor)Congestion avoidance growth rate factor. |
void | setConnectDelay(int delayMs)Delay before starting the connection. |
static void | setDefaultCongestionAvoidanceGrowthRateFactor(int val)Default congestion avoidance growth rate factor, clamped to [1, 4]. |
static void | setDefaultInactivityTimeout(int val)Default inactivity timeout, clamped to [60000, 600000] ms. |
static void | setDefaultInitialAckDelay(int val)Default initial ACK delay, clamped to [10, 500] ms. |
static void | setDefaultResendDelay(int val)Default resend delay, clamped to [100, 3000] ms. |
static void | setDefaultSlowStartGrowthRateFactor(int val)Default slow start growth rate factor, clamped to [1, 4]. |
void | setDisableRejectLogging(boolean yes)Whether connection reject logging is suppressed. |
(package private) static void | setImmediateAckDelay(int val)Immediate ack delay. |
void | setInactivityAction(int action)Action taken when the inactivity timeout fires. |
void | setInactivityTimeout(int timeout)Inactivity timeout before action. |
void | setInboundBufferSize(int bytes)Inbound buffer size in bytes. |
(package private) static void | setInitialRTO(int val)Initial rto. |
(package private) static void | setInitialWindowSize(int val)Initial window size. |
static void | setMaxInboundBufferStatic(int val) |
void | setMaxInitialMessageSize(int bytes) |
void | setMaxMessageSize(int bytes)Maximum message size, floored at MIN_MESSAGE_SIZE. |
static void | setMaxResendDelay(int val) |
void | setMaxResends(int numSends)Maximum retries per message. |
static void | setMaxRTO(int val) |
static void | setMaxRtt(int val)Max RTT, clamped to [1000, 60000] ms. |
(package private) static void | setMaxSlowStartWindow(int val)Max slow start window. |
void | setMaxWindowSize(int msgs)A value of 0 or less resets to the Tuner-managed global default. |
static void | setMinPacingRate(long val)Min pacing rate, clamped to [1024, 256 KB/s]. |
static void | setMinPacingRateKBps(int val)KB/s wrapper for Tuner int reflection |
static void | setMinResendDelay(int val) |
void | setPassiveFlushDelay(int delayMs)Passive flush delay for the output stream. |
void | setProfile(int profile)Connection profile. |
void | setProperties(Properties opts)Update from properties — only applies explicitly set values. |
void | setRequireFullySigned(boolean sign)Whether all packets require signing. |
void | setResendDelay(int ms)Resend delay, clamped to [minResendDelay, maxResendDelay]. |
(package private) static void | setRTOMultiplier(int val) |
void | setSendAckDelay(int delayMs)Changing the default is not recommended. |
void | setSlowStartGrowthRateFactor(int factor)Slow start growth rate factor. |
void | setWindowSize(int numMsgs)Congestion window size in messages. |
String | toString()Human-readable summary of the options. |
void | updateAll(ConnectionOptions opts)Copy all parent-class options then overlay ours from opts. |
void | updateRTT(int measuredValue)Update the smoothed RTT with a new measurement. |
getConnectTimeout, getDouble, getInt, getLocalPort, getMaxBufferSize, getPort, getReadTimeout, getWriteTimeout, init, setConnectTimeout, setLocalPort, setMaxBufferSize, setPort, setReadTimeout, setWriteTimeoutpublic static final int DEFAULT_INITIAL_RTT
public static final int DEFAULT_MAX_MESSAGE_SIZE
public static final int DEFAULT_MAX_MESSAGE_SIZE_RATCHET
static final int DEFAULT_MAX_SENDS
public static final int DEFAULT_TAG_THRESHOLD
public static final int DEFAULT_TAGS_TO_SEND
static volatile int defaultInactivityTimeout
public static final int INACTIVITY_ACTION_DISCONNECT
public static final int INACTIVITY_ACTION_NOOP
public static final int INACTIVITY_ACTION_SEND
static volatile int initialWindowSize
static volatile int maxSlowStartWindow
public static final int MIN_MESSAGE_SIZE
static final int MIN_WINDOW_SIZE
public static final String PROP_ACCESS_LIST
public static final String PROP_ANSWER_PINGS
public static final String PROP_CONGESTION_AVOIDANCE_GROWTH_RATE_FACTOR
public static final String PROP_CONNECT_DELAY
public static final String PROP_DISABLE_REJ_LOG
public static final String PROP_ENABLE_ACCESS_LIST
public static final String PROP_ENABLE_BLACKLIST
public static final String PROP_INACTIVITY_ACTION
public static final String PROP_INACTIVITY_TIMEOUT
public static final String PROP_INITIAL_ACK_DELAY
public static final String PROP_INITIAL_RESEND_DELAY
public static final String PROP_INITIAL_WINDOW_SIZE
public static final String PROP_LIMIT_ACTION
public static final String PROP_MAX_CONNS_DAY
public static final String PROP_MAX_CONNS_HOUR
public static final String PROP_MAX_CONNS_MIN
public static final String PROP_MAX_MESSAGE_SIZE
public static final String PROP_MAX_RESENDS
static final String PROP_MAX_RTO
public static final String PROP_MAX_STREAMS
public static final String PROP_MAX_TOTAL_CONNS_DAY
public static final String PROP_MAX_TOTAL_CONNS_HOUR
public static final String PROP_MAX_TOTAL_CONNS_MIN
public static final String PROP_MAX_WINDOW_SIZE
public static final String PROP_PASSIVE_FLUSH_DELAY
static final String PROP_RTO_MULTIPLIER
public static final String PROP_SLOW_START_GROWTH_RATE_FACTOR
public static final String PROP_TAG_THRESHOLD
public static final String PROP_TAGS_TO_SEND
public ConnectionOptions()
public ConnectionOptions(ConnectionOptions opts)
opts - options to copy, may be nullpublic ConnectionOptions(I2PSocketOptions opts)
opts - options to copy, may be nullpublic ConnectionOptions(Properties opts)
opts - properties to initialize from, may be nullint doubleRTO()
public boolean getAnswerPings()
public int getCongestionAvoidanceGrowthRateFactor()
public int getConnectDelay()
public static int getDefaultCongestionAvoidanceGrowthRateFactorStatic()
public static int getDefaultInactivityTimeout()
public static int getDefaultInitialAckDelay()
public static int getDefaultResendDelayStatic()
public static int getDefaultSlowStartGrowthRateFactorStatic()
public boolean getDisableRejectLogging()
static int getImmediateAckDelayStatic()
public int getInactivityAction()
public int getInactivityTimeout()
public int getInboundBufferSize()
static int getInitialRTO()
static int getInitialWindowSize()
public String getLimitAction()
public int getMaxConns()
public int getMaxConnsPerDay()
public int getMaxConnsPerHour()
public int getMaxConnsPerMinute()
public static int getMaxInboundBufferStatic()
public int getMaxInitialMessageSize()
public int getMaxMessageSize()
public int getMaxPacketCount()
public static int getMaxResendDelayStatic()
public int getMaxResends()
public static int getMaxRTOStatic()
public static int getMaxRttStatic()
static int getMaxSlowStartWindowStatic()
public int getMaxTotalConnsPerDay()
public int getMaxTotalConnsPerHour()
public int getMaxTotalConnsPerMinute()
public int getMaxWindowSize()
public static long getMinPacingRate()
public static int getMinPacingRateKBps()
public static int getMinResendDelayStatic()
public int getMinRTT()
public int getPassiveFlushDelay()
public int getProfile()
public boolean getRequireFullySigned()
public int getResendDelay()
public int getRTO()
static int getRTOMultiplier()
public int getRTT()
int getRTTDev()
public int getSendAckDelay()
public int getSlowStartGrowthRateFactor()
public int getTagsToSend()
public int getTagThreshold()
public int getWindowSize()
public boolean isAccessListEnabled()
public boolean isBlacklistEnabled()
void loadFromCache(int rtt,
int rttDev,
int wdw)rtt - cached RTT value in msrttDev - cached RTT deviation in mswdw - cached window sizepublic boolean receivedAck()
public void setAnswerPings(boolean yes)
yes - true to respond to pingspublic void setCongestionAvoidanceGrowthRateFactor(int factor)
public void setConnectDelay(int delayMs)
delayMs - delay before starting connection, in mspublic static void setDefaultCongestionAvoidanceGrowthRateFactor(int val)
public static void setDefaultInactivityTimeout(int val)
public static void setDefaultInitialAckDelay(int val)
public static void setDefaultResendDelay(int val)
public static void setDefaultSlowStartGrowthRateFactor(int val)
public void setDisableRejectLogging(boolean yes)
yes - true to suppress reject log messagesstatic void setImmediateAckDelay(int val)
public void setInactivityAction(int action)
public void setInactivityTimeout(int timeout)
public void setInboundBufferSize(int bytes)
static void setInitialRTO(int val)
static void setInitialWindowSize(int val)
public static void setMaxInboundBufferStatic(int val)
public void setMaxInitialMessageSize(int bytes)
public void setMaxMessageSize(int bytes)
public static void setMaxResendDelay(int val)
public void setMaxResends(int numSends)
public static void setMaxRTO(int val)
public static void setMaxRtt(int val)
static void setMaxSlowStartWindow(int val)
public void setMaxWindowSize(int msgs)
public static void setMinPacingRate(long val)
public static void setMinPacingRateKBps(int val)
public static void setMinResendDelay(int val)
public void setPassiveFlushDelay(int delayMs)
delayMs - 0 to use Tuner-managed global default, positive for explicit delaypublic void setProfile(int profile)
public void setProperties(Properties opts)
setProperties in class I2PSocketOptionsImplopts - properties to apply, may be nullpublic void setRequireFullySigned(boolean sign)
sign - true to require all packets signedpublic void setResendDelay(int ms)
static void setRTOMultiplier(int val)
public void setSendAckDelay(int delayMs)
public void setSlowStartGrowthRateFactor(int factor)
public void setWindowSize(int numMsgs)
numMsgs - clamped to [MIN_WINDOW_SIZE, maxWindowSize]public String toString()
public void updateAll(ConnectionOptions opts)
opts - source options to copy from, may be nullpublic void updateRTT(int measuredValue)
measuredValue - must be positive