2004-11-16 jrandom

* Clean up the propogation of i2psocket options so that various streaming
      libs can honor them more precisely
This commit is contained in:
jrandom
2004-11-16 22:11:11 +00:00
committed by zzz
parent 4a4f57d6ac
commit d943b4993a
9 changed files with 171 additions and 81 deletions

View File

@@ -185,8 +185,10 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
*
*/
private I2PSocketOptions getDefaultOptions() {
I2PSocketOptions opts = new I2PSocketOptions();
opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
Properties defaultOpts = getTunnel().getClientOptions();
I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts);
if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT))
opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
return opts;
}

View File

@@ -81,7 +81,7 @@ public abstract class SOCKSServer {
if (connHostName.toLowerCase().endsWith(".i2p")) {
_log.debug("connecting to " + connHostName + "...");
I2PSocketManager sm = I2PSocketManagerFactory.createManager();
destSock = sm.connect(I2PTunnel.destFromName(connHostName), new I2PSocketOptions());
destSock = sm.connect(I2PTunnel.destFromName(connHostName), null);
confirmConnection();
_log.debug("connection confirmed - exchanging data...");
} else {