Search in sources :

Example 11 with I2PThread

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

the class Writer method startWriting.

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

Example 12 with I2PThread

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

the class ACKSender method startup.

public synchronized void startup() {
    _alive = true;
    _peersToACK.clear();
    I2PThread t = new I2PThread(this, "UDP ACK sender", true);
    t.start();
}
Also used : I2PThread(net.i2p.util.I2PThread)

Example 13 with I2PThread

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

the class ClientConnectionRunner method startRunning.

/**
 * Actually run the connection - listen for I2CP messages and respond.  This
 * is the main driver for this class, though it gets all its meat from the
 * {@link net.i2p.data.i2cp.I2CPMessageReader I2CPMessageReader}
 */
public synchronized void startRunning() throws IOException {
    if (_dead || _reader != null)
        throw new IllegalStateException();
    _reader = new I2CPMessageReader(new BufferedInputStream(_socket.getInputStream(), BUF_SIZE), createListener());
    _writer = new ClientWriterRunner(_context, this);
    I2PThread t = new I2PThread(_writer);
    t.setName("I2CP Writer " + __id.incrementAndGet());
    t.setDaemon(true);
    t.start();
    _out = new BufferedOutputStream(_socket.getOutputStream());
    _reader.startReading();
// TODO need a cleaner for unclaimed items in _messages, but we have no timestamps...
}
Also used : BufferedInputStream(java.io.BufferedInputStream) I2PThread(net.i2p.util.I2PThread) I2CPMessageReader(net.i2p.data.i2cp.I2CPMessageReader) BufferedOutputStream(java.io.BufferedOutputStream)

Example 14 with I2PThread

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

the class UPnP method unregisterPorts.

/**
 *  postControlAction() can take many seconds, especially if it's failing,
 *  and onChangePublicPorts() may be called from threads we don't want to slow down,
 *  so throw this in a thread.
 */
private void unregisterPorts(Set<ForwardPort> portsToForwardNow) {
    if (_log.shouldLog(Log.INFO))
        _log.info("Starting thread to un-forward " + portsToForwardNow.size() + " ports");
    Thread t = new I2PThread(new UnregisterPortsThread(portsToForwardNow));
    t.setName("UPnP Port Closer " + __id.incrementAndGet());
    t.setDaemon(true);
    t.start();
}
Also used : I2PThread(net.i2p.util.I2PThread) I2PThread(net.i2p.util.I2PThread)

Example 15 with I2PThread

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

the class PacketPusher method startup.

public synchronized void startup() {
    _alive = true;
    I2PThread t = new I2PThread(this, "UDP packet pusher", true);
    t.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