mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-01-07 16:03:09 +00:00
The previous version was based on the assumption that that the future of waitMessage is triggered in the event loop before the next message arrives. This seems to be true with UDP, where a full cycle of the loop handles only one datagram, but not true with other transports, such as the in-memory emulation. This led to the following behavior: - 1st response arrives, reqId removed, waitMessage called - 2nd ... last messages arrive, can't find reqId, so dropped - waitMessage competes, re-adding reqId, but too late The new version solves this by collecting SPRs explicitly Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>