TxMessageAttempts optionally ignores offline attempts #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add build switch
MO_TX_ATTEMPT_TIMEOUT
to control if a message timeout should increment the TxMessageAttempts counter.MO only attempts to send messages when the WebSocket is in the connected state. This is, however, no guarantee that the signal strength is sufficient so that the messages actually arrive at the server and in consequence, the attempt fails. During long periods with bad signal strength, the connection could frequently switch between the connected and unconnected states without ever allowing OCPP operations to pass through. MO would effectively drop the offline tx queue then, even though there is nothing wrong with these messages themselves.
The new option
MO_TX_ATTEMPT_TIMEOUT
allows to control what happens if tx-related messages time out. In the default setting,MO_TX_ATTEMPT_TIMEOUT=1
, a timed-out message increments the attempt counter (current behavior).MO_TX_ATTEMPT_TIMEOUT=0
defines that time-outs should leave the attempt counter like before (optional, new behavior).