Changeset 657f13a for apps/streaming


Ignore:
Timestamp:
Jun 3, 2015 5:25:25 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
099515a
Parents:
47c4c0d
Message:

Remove ConnectionManager? ref from PacketQueue?

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

Legend:

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

    r47c4c0d r657f13a  
    874874    public void setOptions(ConnectionOptions opts) { _options = opts; }
    875875       
     876    /** @since 0.9.21 */
     877    public ConnectionManager getConnectionManager() { return _connectionManager; }
     878
    876879    public I2PSession getSession() { return _connectionManager.getSession(); }
    877880    public I2PSocketFull getSocket() { return _socket; }
  • apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionManager.java

    r47c4c0d r657f13a  
    8989        int protocol = defaultOptions.getEnforceProtocol() ? I2PSession.PROTO_STREAMING : I2PSession.PROTO_ANY;
    9090        _session.addMuxedSessionListener(_messageHandler, protocol, defaultOptions.getLocalPort());
    91         _outboundQueue = new PacketQueue(_context, _session, this);
     91        _outboundQueue = new PacketQueue(_context, _session);
    9292        _recentlyClosed = new LHMCache<Long, Object>(32);
    9393        /** Socket timeout for accept() */
  • apps/streaming/java/src/net/i2p/client/streaming/impl/PacketQueue.java

    r47c4c0d r657f13a  
    3030    private final Log _log;
    3131    private final I2PSession _session;
    32     private final ConnectionManager _connectionManager;
    3332    private final ByteCache _cache = ByteCache.getInstance(64, 36*1024);
    3433    private final Map<Long, Connection> _messageStatusMap;
     
    4746    private static final boolean ENABLE_STATUS_LISTEN = true;
    4847
    49     public PacketQueue(I2PAppContext context, I2PSession session, ConnectionManager mgr) {
     48    public PacketQueue(I2PAppContext context, I2PSession session) {
    5049        _context = context;
    5150        _session = session;
    52         _connectionManager = mgr;
    5351        _log = context.logManager().getLog(PacketQueue.class);
    5452        _messageStatusMap = new ConcurrentHashMap<Long, Connection>(16);
     
    214212            }
    215213            Connection c = packet.getConnection();
    216             String suffix = (c != null ? "wsize " + c.getOptions().getWindowSize() + " rto " + c.getOptions().getRTO() : null);
    217             _connectionManager.getPacketHandler().displayPacket(packet, "SEND", suffix);
     214            if (c != null) {
     215                String suffix = "wsize " + c.getOptions().getWindowSize() + " rto " + c.getOptions().getRTO();
     216                c.getConnectionManager().getPacketHandler().displayPacket(packet, "SEND", suffix);
     217            }
    218218            if (I2PSocketManagerFull.pcapWriter != null &&
    219219                _context.getBooleanProperty(I2PSocketManagerFull.PROP_PCAP))
Note: See TracChangeset for help on using the changeset viewer.