forked from I2P_Developers/i2p.i2p
dont start thread in constructor
This commit is contained in:
@@ -287,6 +287,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
||||
_context.statManager().createRateStat("i2ptunnel.httpExpanded", "size transferred after expansion", "I2PTunnel", new long[] { 60*60*1000 });
|
||||
super.startRunning();
|
||||
this.isr = new InternalSocketRunner(this);
|
||||
this.isr.start();
|
||||
_context.portMapper().register(PortMapper.SVC_HTTP_PROXY, getLocalPort());
|
||||
}
|
||||
|
||||
|
@@ -14,20 +14,23 @@ import net.i2p.util.Log;
|
||||
* @author zzz
|
||||
* @since 0.7.9
|
||||
*/
|
||||
class InternalSocketRunner implements Runnable {
|
||||
class InternalSocketRunner extends I2PAppThread {
|
||||
private final I2PTunnelClientBase client;
|
||||
private final int port;
|
||||
private ServerSocket ss;
|
||||
private volatile boolean open;
|
||||
|
||||
/** starts the runner */
|
||||
/**
|
||||
* Does not start the runner, caller must call start()
|
||||
*/
|
||||
InternalSocketRunner(I2PTunnelClientBase client) {
|
||||
super("Internal socket port " + client.getLocalPort());
|
||||
setDaemon(true);
|
||||
this.client = client;
|
||||
this.port = client.getLocalPort();
|
||||
Thread t = new I2PAppThread(this, "Internal socket port " + this.port, true);
|
||||
t.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void run() {
|
||||
try {
|
||||
this.ss = new InternalServerSocket(this.port);
|
||||
|
Reference in New Issue
Block a user