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();
}
}
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();
}
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...
}
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();
}
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();
}
Aggregations