Open zapek opened 3 years ago
When a packet is received, packet_index is checked for increments to see if the userdata needs to be updated: https://github.com/truvorskameikin/udp-discovery-cpp/blob/63eda22d3f8a415324d99208011bc4f2b6583a7e/udp_discovery_peer.cpp#L351
But here: https://github.com/truvorskameikin/udp-discovery-cpp/blob/63eda22d3f8a415324d99208011bc4f2b6583a7e/udp_discovery_peer.cpp#L397
packet_index is incremented everytime a packet is sent, even if the userdata didn't change.
Shouldn't it be increased only if the userdata changed?
That is a good idea to not increment packet_index every send. And I think that it also can be renamed to something like snapshot_index. Now it should increase on every user_data change.
When a packet is received, packet_index is checked for increments to see if the userdata needs to be updated: https://github.com/truvorskameikin/udp-discovery-cpp/blob/63eda22d3f8a415324d99208011bc4f2b6583a7e/udp_discovery_peer.cpp#L351
But here: https://github.com/truvorskameikin/udp-discovery-cpp/blob/63eda22d3f8a415324d99208011bc4f2b6583a7e/udp_discovery_peer.cpp#L397
packet_index is incremented everytime a packet is sent, even if the userdata didn't change.
Shouldn't it be increased only if the userdata changed?