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 |
|---|---|
(package private) static int | _defaultInactivityTimeout |
(package private) static int | _initialWindowSizeRFC 6928 recommends 10; increased to 16 for I2P's high-latency environment. |
(package private) static int | _maxSlowStartWindow |
static int | DEFAULT_INITIAL_RTTDEFAULT_INITIAL_RTT |
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 |
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 |
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_ENFORCE_PROTOReject connections without PROTO_STREAMING flag |
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() |
boolean | getAnswerPings() |
Set<Hash> | getBlacklist() |
int | getCongestionAvoidanceGrowthRateFactor()In congestion avoidance, window grows at 1/(windowSize*factor). |
int | getConnectDelay() |
static int | getDefaultCongestionAvoidanceGrowthRateFactorStatic() |
static int | getDefaultInactivityTimeout() |
static int | getDefaultInitialAckDelay() |
static int | getDefaultResendDelayStatic() |
static int | getDefaultSlowStartGrowthRateFactorStatic() |
boolean | getDisableRejectLogging() |
boolean | getEnforceProtocol()If true, only accept traffic with I2PSession.PROTO_STREAMING (6). |
(package private) static int | getImmediateAckDelayStatic()Immediate ack delay static. |
int | getInactivityAction() |
int | getInactivityTimeout()Inactivity timeout before action in ms |
int | getInboundBufferSize() |
(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() |
int | getMaxConnsPerHour() |
int | getMaxConnsPerMinute() |
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() |
(package private) static int | getMaxSlowStartWindowStatic()Max slow start window static. |
int | getMaxTotalConnsPerDay() |
int | getMaxTotalConnsPerHour() |
int | getMaxTotalConnsPerMinute() |
int | getMaxWindowSize() |
static long | getMinPacingRate() |
static int | getMinPacingRateKBps() |
static int | getMinResendDelayStatic() |
int | getMinRTT()Minimum RTT observed, greater than zero |
int | getPassiveFlushDelay() |
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() |
boolean | isBlacklistEnabled() |
(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) |
void | setCongestionAvoidanceGrowthRateFactor(int factor){_congestionAvoidanceGrowthRateFactor |
void | setConnectDelay(int delayMs) |
static void | setDefaultCongestionAvoidanceGrowthRateFactor(int val)_defaultCongestionAvoidanceGrowthRateFactor |
static void | setDefaultInactivityTimeout(int val)_defaultInactivityTimeout |
static void | setDefaultInitialAckDelay(int val)_defaultInitialAckDelay |
static void | setDefaultResendDelay(int val)_defaultRetransmitDelay |
static void | setDefaultSlowStartGrowthRateFactor(int val)_defaultSlowStartGrowthRateFactor |
void | setDisableRejectLogging(boolean yes) |
void | setEnforceProtocol(boolean yes) |
(package private) static void | setImmediateAckDelay(int val)Immediate ack delay. |
void | setInactivityAction(int action){_inactivityAction |
void | setInactivityTimeout(int timeout){_inactivityTimeout |
void | setInboundBufferSize(int bytes){_inboundBufferSize |
(package private) static void | setInitialRTO(int val)Initial rto. |
(package private) static void | setInitialWindowSize(int val)Initial window size. |
void | setMaxInitialMessageSize(int bytes) |
void | setMaxMessageSize(int bytes)setMaxMessageSize. |
static void | setMaxResendDelay(int val) |
void | setMaxResends(int numSends){_maxResends |
static void | setMaxRTO(int val) |
static void | setMaxRtt(int val)_maxRTT |
(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)_minPacingRate |
static void | setMinPacingRateKBps(int val)KB/s wrapper for Tuner int reflection |
static void | setMinResendDelay(int val) |
void | setPassiveFlushDelay(int delayMs) |
void | setProfile(int profile){_profile |
void | setProperties(Properties opts)Update from properties — only applies explicitly set values. |
void | setRequireFullySigned(boolean sign) |
void | setResendDelay(int ms)setResendDelay. |
(package private) static void | setRTOMultiplier(int val) |
void | setSendAckDelay(int delayMs){_ackDelay |
void | setSlowStartGrowthRateFactor(int factor){_slowStartGrowthRateFactor |
void | setWindowSize(int numMsgs) |
String | toString()toString. |
void | updateAll(ConnectionOptions opts)Copy all parent-class options then overlay ours from opts. |
void | updateRTT(int measuredValue) |
getConnectTimeout, getDouble, getInt, getLocalPort, getMaxBufferSize, getPort, getReadTimeout, getWriteTimeout, init, setConnectTimeout, setLocalPort, setMaxBufferSize, setPort, setReadTimeout, setWriteTimeoutstatic volatile int _defaultInactivityTimeout
static volatile int _initialWindowSize
static volatile int _maxSlowStartWindow
public 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
public static final int INACTIVITY_ACTION_DISCONNECT
public static final int INACTIVITY_ACTION_NOOP
public static final int INACTIVITY_ACTION_SEND
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_ENFORCE_PROTO
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()
public boolean getEnforceProtocol()
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 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 messagespublic void setEnforceProtocol(boolean yes)
yes - true to enforce PROTO_STREAMING flagstatic 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 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 void updateAll(ConnectionOptions opts)
opts - source options to copy from, may be nullpublic void updateRTT(int measuredValue)
measuredValue - must be positive