Пример #1
0
 public void AddPacket(Packet packet)
 {
     lock (_Packets) {
         _Packets.Add (packet);
     }
 }
Пример #2
0
        public bool RequestPiece(int index, Node target)
        {
            if (!HasPiece (index)) {
                return false;
            }

            if (_StepsUntilReadyToSend > 0) {
                return false;
            }

            _StepsUntilReadyToSend = _SendInterval;

            Packet p = new Packet (this, target, index);
            _NodeManager.AddPacket (p);

            return true;
        }
Пример #3
0
 public PacketTail(Packet packet, double size, PacketTail next)
 {
     _Packet = packet;
     _Size = size;
     _Next = next;
     _Delay = _R.Next (1, 4);
 }