Changeset 235058e


Ignore:
Timestamp:
May 25, 2009 3:34:58 AM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
042a08b, e7b0691
Parents:
85963a5
Message:
  • NTCP:
    • Increasse routerinfo send frequency to every 90m (was 9h)
    • Don't send 3 floodfill infos at startup or with routerinfo
File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java

    r85963a5 r235058e  
    104104   
    105105    private static final int META_FREQUENCY = 10*60*1000;
    106     private static final int INFO_FREQUENCY = 6*60*60*1000;
     106    /** how often we send our routerinfo unsolicited */
     107    private static final int INFO_FREQUENCY = 90*60*1000;
    107108    /**
    108109     *  Why this is 16K, and where it is documented, good question?
     
    201202        _establishState = null;
    202203        _nextMetaTime = System.currentTimeMillis() + _context.random().nextInt(META_FREQUENCY);
    203         _nextInfoTime = System.currentTimeMillis() + INFO_FREQUENCY + _context.random().nextInt(INFO_FREQUENCY);
     204        _nextInfoTime = System.currentTimeMillis() + (INFO_FREQUENCY / 2) + _context.random().nextInt(INFO_FREQUENCY);
    204205    }
    205206    public long getClockSkew() { return _clockSkew; }
     
    371372            send(infoMsg);
    372373           
    373             enqueueFloodfillMessage(target);
     374            // See comment below
     375            //enqueueFloodfillMessage(target);
    374376        } else {
    375377            if (_isInbound) {
     
    381383    }
    382384
    383     private static final int PEERS_TO_FLOOD = 3;
     385    //private static final int PEERS_TO_FLOOD = 3;
    384386
    385387    /**
    386388     * to prevent people from losing track of the floodfill peers completely, lets periodically
    387389     * send those we are connected to references to the floodfill peers that we know
    388      */
     390     *
     391     * Do we really need this anymore??? Peers shouldn't lose track anymore, and if they do,
     392     * FloodOnlyLookupJob should recover.
     393     * The bandwidth isn't so much, but it is a lot of extra data at connection startup, which
     394     * hurts latency of new connections.
     395     */
     396/**********
    389397    private void enqueueFloodfillMessage(RouterInfo target) {
    390398        FloodfillNetworkDatabaseFacade fac = (FloodfillNetworkDatabaseFacade)_context.netDb();
     
    415423        }
    416424    }
     425***********/
    417426   
    418427    /**
     
    440449        }
    441450        _nextMetaTime = System.currentTimeMillis() + _context.random().nextInt(META_FREQUENCY);
    442         _nextInfoTime = System.currentTimeMillis() + INFO_FREQUENCY + _context.random().nextInt(INFO_FREQUENCY);
     451        _nextInfoTime = System.currentTimeMillis() + (INFO_FREQUENCY / 2) + _context.random().nextInt(INFO_FREQUENCY);
    443452        if (msgs)
    444453            _transport.getWriter().wantsWrite(this, "outbound established");
     
    466475     */
    467476    synchronized void prepareNextWrite() {
    468         if (FAST_LARGE)
     477        //if (FAST_LARGE)
    469478            prepareNextWriteFast();
    470         else
    471             prepareNextWriteSmall();
    472     }
     479        //else
     480        //    prepareNextWriteSmall();
     481    }
     482/**********  nobody's tried this one in years
    473483    private void prepareNextWriteSmall() {
    474484        if (_log.shouldLog(Log.DEBUG))
     
    564574        if (_nextInfoTime <= System.currentTimeMillis()) {
    565575            enqueueInfoMessage();
    566             _nextInfoTime = System.currentTimeMillis() + INFO_FREQUENCY + _context.random().nextInt(INFO_FREQUENCY);
    567         }
    568     }
     576            _nextInfoTime = System.currentTimeMillis() + (INFO_FREQUENCY / 2) + _context.random().nextInt(INFO_FREQUENCY);
     577        }
     578    }
     579**********/
    569580   
    570581    /**
     
    648659            // perhaps this should check to see if we are bw throttled, etc?
    649660            enqueueInfoMessage();
    650             _nextInfoTime = System.currentTimeMillis() + INFO_FREQUENCY + _context.random().nextInt(INFO_FREQUENCY);
     661            _nextInfoTime = System.currentTimeMillis() + (INFO_FREQUENCY / 2) + _context.random().nextInt(INFO_FREQUENCY);
    651662        }
    652663    }
Note: See TracChangeset for help on using the changeset viewer.