diff --git a/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java b/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java index 88a6f6eea..202ad0eb8 100644 --- a/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java +++ b/src/main/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcaster.java @@ -279,7 +279,6 @@ class BytesExternalizableImpl implements BytesExternalizable { @Override public void writeExternalBytes(@NotNull Bytes destination) { - modificationsComplete.set(true); if (bootstrapRequired.getAndSet(false)) { //destination.write(BOOTSTRAP_BYTES); @@ -307,8 +306,7 @@ class BytesExternalizableImpl implements BytesExternalizable { destination.writeUnsignedShort((int) bytes.remaining()); destination.write(bytes); - if (!(modificationsComplete.get())) - modificationNotifier.onChange(); + } @Override @@ -357,8 +355,7 @@ class BytesExternalizableImpl implements BytesExternalizable { } - private void onChange() { - modificationsComplete.set(false); + public void onChange() { modificationNotifier.onChange(); } @@ -424,18 +421,19 @@ class BytesExternalizableImpl implements BytesExternalizable { public void sendBootStrap() { bootstrapRequired.set(true); - onChange(); + } public void add(InetSocketAddress interfaceAddress) { allNodes.add(interfaceAddress); - onChange(); + } public void add(byte identifier) { allNodes.activeIdentifierBitSet().set(identifier); - onChange(); + } + } \ No newline at end of file diff --git a/src/test/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcasterTest.java b/src/test/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcasterTest.java index 4dc213935..69daa8fa5 100644 --- a/src/test/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcasterTest.java +++ b/src/test/java/net/openhft/chronicle/map/NodeDiscoveryHostPortBroadcasterTest.java @@ -42,12 +42,12 @@ public class NodeDiscoveryHostPortBroadcasterTest extends TestCase { externalizable.add((byte) 3); externalizable.add((byte) 4); externalizable.add((byte) 1); + externalizable.onChange(); Thread.sleep(1000); } - @Test public void testJustListen() throws IOException, InterruptedException { @@ -70,8 +70,6 @@ public class NodeDiscoveryHostPortBroadcasterTest extends TestCase { Thread.sleep(10000000); - - } }