Changeset 7b84676


Ignore:
Timestamp:
Jun 10, 2015 12:37:19 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f341e55
Parents:
fef65c9
Message:

remove session ref from PacketQueue?

Location:
apps/streaming/java/src/net/i2p/client/streaming/impl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionManager.java

    rfef65c9 r7b84676  
    8989        int protocol = defaultOptions.getEnforceProtocol() ? I2PSession.PROTO_STREAMING : I2PSession.PROTO_ANY;
    9090        _session.addMuxedSessionListener(_messageHandler, protocol, defaultOptions.getLocalPort());
    91         _outboundQueue = new PacketQueue(_context, _session);
     91        _outboundQueue = new PacketQueue(_context);
    9292        _recentlyClosed = new LHMCache<Long, Object>(32);
    9393        /** Socket timeout for accept() */
     
    894894
    895895    /**
    896      *  @since 0.9.20
     896     *  @since 0.9.21
    897897     */
    898898    @Override
  • apps/streaming/java/src/net/i2p/client/streaming/impl/PacketQueue.java

    rfef65c9 r7b84676  
    2929    private final I2PAppContext _context;
    3030    private final Log _log;
    31     private final I2PSession _session;
    3231    private final ByteCache _cache = ByteCache.getInstance(64, 36*1024);
    3332    private final Map<Long, Connection> _messageStatusMap;
     
    4645    private static final boolean ENABLE_STATUS_LISTEN = true;
    4746
    48     public PacketQueue(I2PAppContext context, I2PSession session) {
     47    public PacketQueue(I2PAppContext context) {
    4948        _context = context;
    50         _session = session;
    5149        _log = context.logManager().getLog(PacketQueue.class);
    5250        _messageStatusMap = new ConcurrentHashMap<Long, Connection>(16);
     
    154152                }
    155153            }
     154            I2PSession session = packet.getSession();
    156155            if (listenForStatus) {
    157                 long id = _session.sendMessage(packet.getTo(), buf, 0, size,
     156                long id = session.sendMessage(packet.getTo(), buf, 0, size,
    158157                                 I2PSession.PROTO_STREAMING, packet.getLocalPort(), packet.getRemotePort(),
    159158                                 options, this);
     
    161160                sent = true;
    162161            } else {
    163                 sent = _session.sendMessage(packet.getTo(), buf, 0, size,
     162                sent = session.sendMessage(packet.getTo(), buf, 0, size,
    164163                                 I2PSession.PROTO_STREAMING, packet.getLocalPort(), packet.getRemotePort(),
    165164                                 options);
Note: See TracChangeset for help on using the changeset viewer.