highfidelity/hifi — pull request #3037 by wangyix (2014-06-17 21:45:06+00:00)
Title: Edit nack pull

ACs now detect missing sequence numbers in incoming edit packets and construct NACK packets to send.

Cause: Octree edit packets occasionally get lost.

Fix: SingleSenderStats in OctreeInboundPacketProcessor now tracks sequence numbers of incoming octree edit packets to detect and store missing sequence numbers, much like OctreeSceneStats. OctreeInboundProcessor now overrides process() to periodically call sendNackPackets(), a new method which constructs and sends NACK packets of newly-added type PacketTypeVoxelEditNack, PacketTypeParticleEditNack, or PacketTypeModelEditNack.
On the Application side, OctreeEditPacketSender now has a SentPacketHistory for each connected node. When an edit NACK is received from a node, it immediately finds the NACKed packets in the corresponding history and queues those packets to that node.

Testing: Code was added to randomly drop edit packets. Voxel, particle, and model server ACs were run locally with debug prints to see if lost packets were being recovered. It was verified that NACK packets were being constructed correctly and parsed correctly on the Application side. Dropped packets were indeed being received by the correct ACs.