/** * Cannot be restarted (socket is final) */ public synchronized void startup() { //adjustDropProbability(); _keepRunning = true; I2PThread t = new I2PThread(_runner, _name, true); t.start(); }
public void startup() { _alive = true; I2PThread t = new I2PThread(this, "UDP outbound refiller", true); t.start(); } public void shutdown() { _alive = false; }
public synchronized void startup() { _keepReading = true; for (int i = 0; i < _handlers.length; i++) { I2PThread t = new I2PThread(_handlers[i], "UDP Packet handler " + (i+1) + '/' + _handlers.length, true); t.start(); } }
public synchronized void startup() { _alive = true; I2PThread t = new I2PThread(this, "UDP packet pusher", true); t.start(); }
public synchronized void startup() { _alive = true; _peersToACK.clear(); I2PThread t = new I2PThread(this, "UDP ACK sender", true); t.start(); }
public synchronized void startReading(int numReaders) { for (int i = 1; i <= numReaders; i++) { Runner r = new Runner(); I2PThread t = new I2PThread(r, "NTCP reader " + i + '/' + numReaders, true); _runners.add(r); t.start(); } }
public synchronized void startWriting(int numWriters) { for (int i = 1; i <=numWriters; i++) { Runner r = new Runner(); I2PThread t = new I2PThread(r, "NTCP writer " + i + '/' + numWriters, true); _runners.add(r); t.start(); } } public synchronized void stopWriting() {
/** Creates a new instance of TunnelGatewayPumper */ public TunnelGatewayPumper(RouterContext ctx) { _context = ctx; _wantsPumping = new LinkedHashSet<PumpedTunnelGateway>(16); _backlogged = new HashSet<PumpedTunnelGateway>(16); if (ctx.getBooleanProperty("i2p.dummyTunnelManager")) { _pumpers = 1; } else { long maxMemory = SystemVersion.getMaxMemory(); _pumpers = (int) Math.max(MIN_PUMPERS, Math.min(MAX_PUMPERS, 1 + (maxMemory / (32*1024*1024)))); } for (int i = 0; i < _pumpers; i++) new I2PThread(this, "Tunnel GW pumper " + (i+1) + '/' + _pumpers, true).start(); }
/** * Start the pumper. * @since 0.9.19 */ public void startup() { _alive = true; I2PThread pumperThread = new I2PThread(_pumper, "Job Queue Pumper", true); pumperThread.setPriority(Thread.NORM_PRIORITY + 1); pumperThread.start(); }
/** * Load the profiles in a separate thread, so we don't spend * forever in the constructor (slowing down the Router constructor * via RouterContext.initAll()). * This also instantiates Reorg, so only call this once * * @since 0.8.8 */ private void loadProfilesInBackground() { (new I2PThread(new ProfileLoader())).start(); }
/** * Cannot be restarted (socket is final) */ public synchronized void startup() { if (_log.shouldLog(Log.DEBUG)) _log.debug("Starting the runner: " + _name); _keepRunning = true; I2PThread t = new I2PThread(_runner, _name, true); t.start(); }
public synchronized void startup() { _alive = true; for (int i = 0; i < _threadCount; i++) { I2PThread t = new I2PThread(new Runner(), "UDP message receiver " + (i+1) + '/' + _threadCount, true); t.start(); } }
public synchronized void startup() { _alive = true; I2PThread t = new I2PThread(new Establisher(), "UDP Establisher", true); t.start(); }
public synchronized void startPumping() { if (_log.shouldLog(Log.INFO)) _log.info("Starting pumper"); try { _selector = Selector.open(); _alive = true; new I2PThread(this, "NTCP Pumper", true).start(); } catch (IOException ioe) { _log.log(Log.CRIT, "Error opening the NTCP selector", ioe); } catch (java.lang.InternalError jlie) { // "unable to get address of epoll functions, pre-2.6 kernel?" _log.log(Log.CRIT, "Error opening the NTCP selector", jlie); } }
public void streamConnectedReceived(String dest, int id) { _log.debug("Connection " + id + " received from " + dest); Flooder flooder = new Flooder(id, dest); synchronized (_remotePeers) { _remotePeers.put(new Integer(id), flooder); } I2PThread t = new I2PThread(flooder, "Flood " + id); t.start(); }
public void startup() { _alive = true; I2PThread t = new I2PThread(this, "flooder"); t.setDaemon(true); t.start(); }
public BufferedStatLog(I2PAppContext ctx) { _context = ctx; _log = ctx.logManager().getLog(BufferedStatLog.class); _events = new StatEvent[BUFFER_SIZE]; if (DISABLE_LOGGING) return; for (int i = 0; i < BUFFER_SIZE; i++) _events[i] = new StatEvent(); _eventNext = 0; _lastWrite = _events.length-1; _statFilters = new ArrayList<String>(10); _flushFrequency = 500; updateFilters(); I2PThread writer = new I2PThread(new StatLogWriter(), "StatLogWriter"); writer.setDaemon(true); writer.start(); }
/** does nothing since we aren't threaded */ public synchronized void startup() { _alive = true; _dispatchThreaded = DEFAULT_DISPATCH_THREADED; String threadedStr = _context.getProperty(PROP_DISPATCH_THREADED); if (threadedStr != null) { _dispatchThreaded = Boolean.parseBoolean(threadedStr); } if (_dispatchThreaded) { _context.statManager().createRateStat("pool.dispatchDataTime", "How long a tunnel dispatch takes", "Tunnels", new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l }); _context.statManager().createRateStat("pool.dispatchGatewayTime", "How long a tunnel gateway dispatch takes", "Tunnels", new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l }); I2PThread data = new I2PThread(new TunnelDataDispatcher(), "Tunnel data dispatcher"); data.setDaemon(true); data.start(); I2PThread gw = new I2PThread(new TunnelGatewayDispatcher(), "Tunnel gateway dispatcher"); gw.setDaemon(true); gw.start(); } }
private static void testBob(String sessionName, String host, int port, String conOptions) { I2PThread t = new I2PThread(new TestBob(sessionName, host, port, conOptions), sessionName); t.start(); } private static class TestBob implements Runnable {
public synchronized void startup() { _isShutdown = false; if (!_executor.isRunning()) { I2PThread t = new I2PThread(_executor, "BuildExecutor", true); t.start(); _handler.init(); for (int i = 1; i <= _numHandlerThreads; i++) { I2PThread hThread = new I2PThread(_handler, "BuildHandler " + i + '/' + _numHandlerThreads, true); hThread.start(); } } _inboundExploratory.startup(); _context.simpleTimer2().addEvent(new DelayedStartup(_outboundExploratory), 3*1000); // try to build up longer tunnels _context.jobQueue().addJob(new BootstrapPool(_context, _inboundExploratory)); _context.jobQueue().addJob(new BootstrapPool(_context, _outboundExploratory)); }