/** * @since 0.9.10 */ private void startThread() { I2PAppThread t = new I2PAppThread(this, "BOBListener"); t.start(); _runner = t; }
/** * @since 0.9.6 */ private void startThread() { I2PAppThread t = new I2PAppThread(this, "SAMListener " + _listenPort); if (Boolean.parseBoolean(System.getProperty("sam.shutdownOnOOM"))) { t.addOOMEventThreadListener(new I2PAppThread.OOMEventListener() { public void outOfMemory(OutOfMemoryError err) { err.printStackTrace(); System.err.println("OOMed, die die die"); System.exit(-1); } }); } t.start(); _runner = t; }
/** use socket from UDPSink */ public UDPSource(DatagramSocket sock) { this.sock = sock; this.thread = new I2PAppThread(this); }
/** * Waits up to <code>timeout</code> milliseconds for the background threads to end. * @param timeout In milliseconds */ private void awaitShutdown(long timeout) { long deadline = System.currentTimeMillis() + timeout; // the time at which any background threads that are still running are interrupted for (I2PAppThread thread: backgroundThreads) if (thread != null) try { long remainingTime = deadline - System.currentTimeMillis(); // the time until the original timeout if (remainingTime < 0) return; thread.join(remainingTime); } catch (InterruptedException e) { log.error("Interrupted while waiting for thread <" + thread.getName() + "> to exit", e); return; } }
public Pinger() { this.thread = new I2PAppThread(this); }
/** * Start handling the SAM connection, detaching an handling thread. * */ public final void startHandling() { thread = new I2PAppThread(this, getClass().getSimpleName()); thread.start(); }
public void timeReached() { _event = null; _thread = new I2PAppThread(TrackerClient.this, _threadName + " #" + (++_runCount), true); _thread.start(); } }
public void startTunnelBackground() { synchronized (this) { if (_state != TunnelState.STOPPED && _state != TunnelState.START_ON_LOAD) return; } new I2PAppThread(new Runnable() { public void run() { startTunnel(); } }, "Tunnel Starter " + getName()).start(); }
public void start() { if (server != null) { Thread t = new I2PAppThread(server, "SAMStreamSessionServer"); t.start(); } }
public synchronized void startReading() { if (_live) throw new IllegalStateException(); _live = true; I2PAppThread t = new I2PAppThread(new Runner(), "SAM reader " + _count.incrementAndGet()); t.start(); _thread = t; }
/** * Overridden to start the acceptor. */ @Override public void start() { Thread t = new I2PAppThread(streamAcceptor, "SAMMasterAcceptor"); t.start(); }
private void send(OutputStream samOut, SAMEventHandler eventHandler, int mode) throws IOException { Sender sender = new Sender(samOut, eventHandler, mode); boolean ok = sender.openConnection(); if (ok) { I2PAppThread t = new I2PAppThread(sender, "Sender"); t.start(); } else { throw new IOException("Sender failed to connect"); } }
public void start() { Thread t = new I2PAppThread(handler, "SAMMessageSessionHandler"); t.start(); }
/** * Start all of the tunnels. Must call loadControllers() first. * @since 0.9.20 */ private synchronized void startControllers() { changeState(STARTING); I2PAppThread startupThread = new I2PAppThread(new StartControllers(), "Startup tunnels"); startupThread.start(); changeState(RUNNING); }
public void startup() { thread = new I2PAppThread(this, "Snark sender " + _id + ": " + peer); thread.start(); }
public void timeReached() { if (!_isRunning) return; if (_knownNodes.size() > 0) (new I2PAppThread(new ExplorerThread(), "DHT Explore", true)).start(); else schedule(60*1000); } }
/** * @since 0.9.11 */ public void startWriting() { Thread t = new I2PAppThread(this, "I2CP Client Writer " + __Id.incrementAndGet(), true); t.start(); }
I2PAppThread t = new I2PAppThread(reader, "SAMReader" + id); t.start(); t = new I2PAppThread(sender, "SAMSender" + id); t.start();
/** * @throws RuntimeException on DatagramSocket IOException */ public UDPSource(int port) { // create udp-socket try { this.sock = new DatagramSocket(port); } catch (IOException e) { throw new RuntimeException("failed to listen...", e); } // create thread this.thread = new I2PAppThread(this); }