Fixed the bug that caused all the lost acks. We just gave the new acks a random id, but we didnt check if we already had an ack with that id.
This commit is contained in:
parent
d7d9ba242e
commit
76fde044e3
@ -106,6 +106,9 @@ public class Node {
|
||||
*/
|
||||
private Ack generateAck(final SocketAddress addr) {
|
||||
int ack_id = generator.nextInt();
|
||||
while (acks.containsKey(ack_id)) {
|
||||
ack_id = generator.nextInt();
|
||||
}
|
||||
Ack newAck = new Ack(ack_id, addr, channel);
|
||||
|
||||
acks.put(ack_id, newAck);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user