diff --git a/aeron-driver/src/main/java/io/aeron/driver/NetworkPublication.java b/aeron-driver/src/main/java/io/aeron/driver/NetworkPublication.java index 3cedff1d36..dff391cc3f 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/NetworkPublication.java +++ b/aeron-driver/src/main/java/io/aeron/driver/NetworkPublication.java @@ -102,7 +102,7 @@ public enum State private final boolean isExclusive; private final boolean spiesSimulateConnection; private volatile long timeOfLastStatusMessageMs; - private volatile boolean isSubscriptionConnected; + private volatile boolean hasReceivers; private volatile boolean hasSenderReleased; private volatile boolean isEndOfStream; private volatile boolean hasSpiesConnected; @@ -365,9 +365,9 @@ public void onStatusMessage(final StatusMessageFlyweight msg, final InetSocketAd { timeOfLastStatusMessageMs = epochClock.time(); - if (!isSubscriptionConnected) + if (!hasReceivers) { - isSubscriptionConnected = true; + hasReceivers = true; } senderLimit.setOrdered( @@ -425,7 +425,7 @@ int updatePublisherLimit() int workCount = 0; final long senderPosition = this.senderPosition.getVolatile(); - if (isSubscriptionConnected || (spiesSimulateConnection && spyPositions.length > 0)) + if (hasReceivers || (spiesSimulateConnection && spyPositions.length > 0)) { long minConsumerPosition = senderPosition; if (spyPositions.length > 0) @@ -525,7 +525,7 @@ private void setupMessageCheck(final long nowNs, final int activeTermId, final i timeOfLastSetupNs = nowNs; timeOfLastSendOrHeartbeatNs = nowNs; - if (isSubscriptionConnected) + if (hasReceivers) { shouldSendSetupFrame = false; } @@ -632,9 +632,9 @@ private boolean spiesFinishedConsuming(final DriverConductor conductor, final lo private void updateConnectedStatus(final long timeMs) { - if (isSubscriptionConnected && timeMs > (timeOfLastStatusMessageMs + PUBLICATION_CONNECTION_TIMEOUT_MS)) + if (hasReceivers && timeMs > (timeOfLastStatusMessageMs + PUBLICATION_CONNECTION_TIMEOUT_MS)) { - isSubscriptionConnected = false; + hasReceivers = false; } if (spiesSimulateConnection && spyPositions.length > 0) @@ -669,7 +669,7 @@ public void onTimeEvent(final long timeNs, final long timeMs, final DriverConduc break; } - if (isSubscriptionConnected) + if (hasReceivers) { break; }