From 9d571d7fcfce3fb174de56cb87469a6aabf830ee Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Fri, 26 Sep 2014 15:33:39 +0100 Subject: [PATCH] HCOLL-134 ( release draft cut of the code so that I can test it across my network ) --- .../map/NodeDiscoveryHostPortBroadcaster.java | 14 ++++++-------- .../map/NodeDiscoveryHostPortBroadcasterTest.java | 4 +--- 2 files changed, 7 insertions(+), 11 deletions(-) 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); - - } }