Class MultiPeerUploader

  • All Implemented Interfaces:
    RateControlledEntity

    public class MultiPeerUploader
    extends java.lang.Object
    implements RateControlledEntity
    A rate-controlled write entity backed by multiple peer connections, with an emphasis on transmitting packets with full payloads, i.e. it writes to the transport in mss-sized chunks if at all possible. It also employs fair, round-robin write scheduling, where connections each take turns writing a single full packet per round.
    • Field Detail

      • last_flush_check_time

        private long last_flush_check_time
      • destroyed

        private boolean destroyed
      • waiting_connections

        final java.util.HashMap waiting_connections
      • ready_connections

        private final java.util.LinkedList ready_connections
    • Constructor Detail

      • MultiPeerUploader

        public MultiPeerUploader​(RateHandler rate_handler)
        Create a new packet-filling multi-peer upload entity, rate-controlled by the given handler.
        Parameters:
        rate_handler - listener to handle upload rate limits