Changeset ca91ad3


Ignore:
Timestamp:
Sep 8, 2012 12:34:34 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2c866e2
Parents:
33de6be
Message:
Location:
router/java/src/net/i2p/router/transport/udp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/udp/InboundMessageState.java

    r33de6be rca91ad3  
    44import net.i2p.data.Hash;
    55import net.i2p.router.RouterContext;
     6import net.i2p.router.util.CDQEntry;
    67import net.i2p.util.ByteCache;
    78import net.i2p.util.Log;
     
    1314 * InboundMessageFragments to avoid use-after-release, etc.
    1415 */
    15 class InboundMessageState {
     16class InboundMessageState implements CDQEntry {
    1617    private final RouterContext _context;
    1718    private final Log _log;
     
    3031    private int _lastFragment;
    3132    private final long _receiveBegin;
     33    private long _enqueueTime;
    3234    private int _completeSize;
    3335    private boolean _released;
     
    139141    }
    140142
     143    /**
     144     *  For CDQ
     145     *  @since 0.9.3
     146     */
     147    public void setEnqueueTime(long now) {
     148        _enqueueTime = now;
     149    }
     150
     151    /**
     152     *  For CDQ
     153     *  @since 0.9.3
     154     */
     155    public long getEnqueueTime() {
     156        return _enqueueTime;
     157    }
     158
     159    /**
     160     *  For CDQ
     161     *  @since 0.9.3
     162     */
     163    public void drop() {
     164        releaseResources();
     165    }
     166
    141167    public Hash getFrom() { return _from; }
    142168
  • router/java/src/net/i2p/router/transport/udp/MessageReceiver.java

    r33de6be rca91ad3  
    22
    33import java.util.concurrent.BlockingQueue;
    4 import java.util.concurrent.LinkedBlockingQueue;
    54
    65import net.i2p.data.Base64;
     
    1110import net.i2p.data.i2np.I2NPMessageImpl;
    1211import net.i2p.router.RouterContext;
     12import net.i2p.router.util.CoDelBlockingQueue;
    1313//import net.i2p.util.ByteCache;
    1414import net.i2p.util.HexDump;
     
    5656            qsize = (int) Math.max(MIN_QUEUE_SIZE, Math.min(MAX_QUEUE_SIZE, maxMemory / (2*1024*1024)));
    5757        }
    58         _completeMessages = new LinkedBlockingQueue(qsize);
     58        _completeMessages = new CoDelBlockingQueue(ctx, "UDP-MessageReceiver", qsize);
    5959
    6060        // the runners run forever, no need to have a cache
Note: See TracChangeset for help on using the changeset viewer.