mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Don't use exponential backoff between multicast packets.
This commit is contained in:
@@ -42,6 +42,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(LanTcpPlugin.class.getName());
|
Logger.getLogger(LanTcpPlugin.class.getName());
|
||||||
|
private static final int MULTICAST_INTERVAL = 1000; // 1 second
|
||||||
|
|
||||||
private final Clock clock;
|
private final Clock clock;
|
||||||
|
|
||||||
@@ -275,8 +276,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
packet.setPort(mcast.getPort());
|
packet.setPort(mcast.getPort());
|
||||||
long now = clock.currentTimeMillis();
|
long now = clock.currentTimeMillis();
|
||||||
long end = now + timeout;
|
long end = now + timeout;
|
||||||
long interval = 1000;
|
long nextPacket = now + MULTICAST_INTERVAL;
|
||||||
long nextPacket = now + 1;
|
|
||||||
try {
|
try {
|
||||||
while(now < end) {
|
while(now < end) {
|
||||||
try {
|
try {
|
||||||
@@ -289,8 +289,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
if(now < end) {
|
if(now < end) {
|
||||||
ms.send(packet);
|
ms.send(packet);
|
||||||
now = clock.currentTimeMillis();
|
now = clock.currentTimeMillis();
|
||||||
nextPacket = now + interval;
|
nextPacket = now + MULTICAST_INTERVAL;
|
||||||
interval += 1000;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!running) return null;
|
if(!running) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user