* I2PTunnel:

- Switch all I2PThreads to I2PAppThreads
      - Run an InternalSocket as well for the HTTP Proxy
    * EepGet: Use InternalSocket
    * Console: Change "depth" to "length"
This commit is contained in:
zzz
2009-12-07 21:25:27 +00:00
parent deae0e8856
commit fb21fb25ee
16 changed files with 126 additions and 41 deletions

View File

@ -16,6 +16,7 @@ import java.util.StringTokenizer;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.util.InternalSocket;
/**
* EepGet [-p 127.0.0.1:4444]
@ -869,7 +870,7 @@ public class EepGet {
if (_proxy != null) try { _proxy.close(); } catch (IOException ioe) {}
if (_shouldProxy) {
_proxy = new Socket(_proxyHost, _proxyPort);
_proxy = InternalSocket.getSocket(_proxyHost, _proxyPort);
} else {
try {
URL url = new URL(_actualURL);

View File

@ -63,13 +63,24 @@ public class InternalSocket extends Socket {
@Override
public void close() {
try {
if (_is != null) _is.close();
if (_is != null) {
_is.close();
_is = null;
}
} catch (IOException ie) {}
try {
if (_os != null) _os.close();
if (_os != null) {
_os.close();
_os = null;
}
} catch (IOException ie) {}
}
@Override
public boolean isClosed() {
return _is == null || _os == null;
}
@Override
public String toString() {
return ("Internal socket");
@ -183,11 +194,6 @@ public class InternalSocket extends Socket {
}
/** @deprecated unsupported */
@Override
public boolean isClosed() {
throw new IllegalArgumentException("unsupported");
}
/** @deprecated unsupported */
@Override
public boolean isConnected() {
throw new IllegalArgumentException("unsupported");
}