Changeset 1aba324


Ignore:
Timestamp:
Oct 15, 2010 1:41:56 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
9afff4f
Parents:
772c1d4
Message:
  • I2PSocketEepGet: Set connect delay to save a RTT, will speed announces in i2psnark
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java

    r772c1d4 r1aba324  
    4646    private I2PSocket _socket;
    4747   
     48    /** from ConnectionOptions */
     49    private static final String PROP_CONNECT_DELAY = "i2p.streaming.connectDelay";
     50    private static final String CONNECT_DELAY = "500";
     51
    4852    public I2PSocketEepGet(I2PAppContext ctx, I2PSocketManager mgr, int numRetries, String outputFile, String url) {
    4953        this(ctx, mgr, numRetries, -1, -1, outputFile, null, url);
     
    124128                props.setProperty(I2PSocketOptions.PROP_CONNECT_TIMEOUT, "" + CONNECT_TIMEOUT);
    125129                props.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, "" + INACTIVITY_TIMEOUT);
     130                // This is important - even if the underlying socket doesn't have a connect delay,
     131                // we want to set it for this connection, so the request headers will go out
     132                // in the SYN packet, saving one RTT.
     133                props.setProperty(PROP_CONNECT_DELAY, CONNECT_DELAY);
    126134                I2PSocketOptions opts = _socketManager.buildOptions(props);
    127135                _socket = _socketManager.connect(dest, opts);
Note: See TracChangeset for help on using the changeset viewer.