Search in sources :

Example 26 with I2PThread

use of net.i2p.util.I2PThread in project i2p.i2p by i2p.

the class PacketHandler method startup.

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();
    }
}
Also used : I2PThread(net.i2p.util.I2PThread)

Example 27 with I2PThread

use of net.i2p.util.I2PThread in project i2p.i2p by i2p.

the class UDPReceiver method startup.

/**
 *  Cannot be restarted (socket is final)
 */
public synchronized void startup() {
    // adjustDropProbability();
    _keepRunning = true;
    I2PThread t = new I2PThread(_runner, _name, true);
    t.start();
}
Also used : I2PThread(net.i2p.util.I2PThread)

Example 28 with I2PThread

use of net.i2p.util.I2PThread in project i2p.i2p by i2p.

the class UDPSender method startup.

/**
 *  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();
}
Also used : I2PThread(net.i2p.util.I2PThread)

Example 29 with I2PThread

use of net.i2p.util.I2PThread in project i2p.i2p by i2p.

the class InNetMessagePool method startup.

/**
 * 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();
    }
}
Also used : I2PThread(net.i2p.util.I2PThread)

Example 30 with I2PThread

use of net.i2p.util.I2PThread in project i2p.i2p by i2p.

the class JobQueue method startup.

/**
 *  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();
}
Also used : I2PThread(net.i2p.util.I2PThread)

Aggregations

I2PThread (net.i2p.util.I2PThread)35 FileInputStream (java.io.FileInputStream)3 IOException (java.io.IOException)3 BufferedInputStream (java.io.BufferedInputStream)1 BufferedOutputStream (java.io.BufferedOutputStream)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 InputStreamReader (java.io.InputStreamReader)1 OutputStream (java.io.OutputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Socket (java.net.Socket)1 SocketException (java.net.SocketException)1 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 Destination (net.i2p.data.Destination)1 I2CPMessageReader (net.i2p.data.i2cp.I2CPMessageReader)1 I2PAppThread (net.i2p.util.I2PAppThread)1 ForwardPort (org.freenetproject.ForwardPort)1 ForwardPortStatus (org.freenetproject.ForwardPortStatus)1