void PacketSender::queuePacketForSending(const SharedNodePointer& destinationNode, const QByteArray& packet) { NetworkPacket networkPacket(destinationNode, packet); lock(); _packets.push_back(networkPacket); unlock(); _totalPacketsQueued++; _totalBytesQueued += packet.size(); }
void PacketSender::queuePacketForSending(const SharedNodePointer& destinationNode, const QByteArray& packet) { NetworkPacket networkPacket(destinationNode, packet); lock(); _packets.push_back(networkPacket); unlock(); _totalPacketsQueued++; _totalBytesQueued += packet.size(); // Make sure to wake our actual processing thread because we now have packets for it to process. _hasPackets.wakeAll(); }
void ReceivedPacketProcessor::queueReceivedPacket(const SharedNodePointer& sendingNode, const QByteArray& packet) { // Make sure our Node and NodeList knows we've heard from this node. sendingNode->setLastHeardMicrostamp(usecTimestampNow()); NetworkPacket networkPacket(sendingNode, packet); lock(); _packets.push_back(networkPacket); _nodePacketCounts[sendingNode->getUUID()]++; unlock(); // Make sure to wake our actual processing thread because we now have packets for it to process. _hasPackets.wakeAll(); }