Skip to content
Snippets Groups Projects
Commit e83f6bbb authored by akwizgran's avatar akwizgran
Browse files

Don't use exponential backoff between multicast packets.

parent a91f3cdf
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,7 @@ class LanTcpPlugin extends TcpPlugin { ...@@ -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 { ...@@ -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 { ...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment