forked from I2P_Developers/i2p.i2p
better loading from cache
This commit is contained in:
@ -572,21 +572,23 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
|
||||
|
||||
/** used in TCB @since 0.9.8 */
|
||||
int getRTTDev() { return _rttDev; }
|
||||
/** used in TCB @since 0.9.8 */
|
||||
void setRTTDev(int rttDev) { _rttDev = rttDev; }
|
||||
private void setRTTDev(int rttDev) { _rttDev = rttDev; }
|
||||
|
||||
/**
|
||||
* mark these options as loaded from cache.
|
||||
* affects the calculation of RTO
|
||||
* Loads options from TCB cache.
|
||||
*/
|
||||
synchronized void loadedFromCache() {
|
||||
synchronized void loadFromCache(int rtt, int rttDev, int wdw) {
|
||||
_initState = AckInit.STEADY;
|
||||
setRTT(rtt);
|
||||
setRTTDev(rttDev);
|
||||
setWindowSize(wdw);
|
||||
computeRTO();
|
||||
}
|
||||
|
||||
/**
|
||||
* computes RTO based on formula in RFC
|
||||
*/
|
||||
synchronized void computeRTO() {
|
||||
private synchronized void computeRTO() {
|
||||
switch(_initState) {
|
||||
case INIT :
|
||||
throw new IllegalStateException();
|
||||
|
@ -99,11 +99,7 @@ class TCBShare {
|
||||
" RTTDev: "+ rttDev +
|
||||
" wdw: " + wdw );
|
||||
}
|
||||
opts.loadedFromCache();
|
||||
opts.setRTT(rtt);
|
||||
opts.setRTTDev(rttDev);
|
||||
opts.setWindowSize(wdw);
|
||||
opts.computeRTO();
|
||||
opts.loadFromCache(rtt,rttDev,wdw);
|
||||
}
|
||||
|
||||
/** store to cache */
|
||||
|
Reference in New Issue
Block a user