Skip to content

Commit

Permalink
Decrement keepAliveCounter on transition to State.KeepAlive (#1305)
Browse files Browse the repository at this point in the history
Errata 1.04.8 changed Subscription State Table row 9 so that the keep alive counter is decremented upon the initial transition. This results in a keep alive PublishResponse being sent one publishing interval earlier, which better matches the description of the behavior in the spec.

fixes #1304
  • Loading branch information
kevinherron authored Sep 2, 2024
1 parent 74ce06c commit d73a216
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 the Eclipse Milo Authors
* Copyright (c) 2024 the Eclipse Milo Authors
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -937,6 +937,7 @@ private void whenNormal() {
/* Subscription State Table Row 9 */
setState(State.KeepAlive);
resetKeepAliveCounter();
keepAliveCounter--;
} else {
throw new IllegalStateException("unhandled subscription state");
}
Expand Down

0 comments on commit d73a216

Please sign in to comment.