Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate PINGREQ packets on idle input or output. #191

Merged

Conversation

adam-scislowicz
Copy link
Contributor

@adam-scislowicz adam-scislowicz commented May 31, 2022

Extend the PINGREQ logic to send a PINGREQ not only when the client has not generated any outgoing message for the Keep Alive period (ref: 3.1.2.10 Keep Alive (http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349238)). But to also generate a PINGREQ if we have not received any incoming message for the Keep Alive period, then in the case that we are continuously retransmitting a PUBLISH qos1 but receiving no ACK, we will still generate a PINGREQ after the specified Keep Alive delay. The spec explicitly allows a PINGREQ to be sent at any time and so this change in behavior maintains compliance.

Additional configuration options have been added (via the header file). This allows for the specification of different timeouts on idle transmit (TX) vs receive (RX) activity.

The smaller of the runtime configuration keepAliveTimeout and compile time transmit (TX) time timeout are used as the transmit timeout.

source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
@adam-scislowicz adam-scislowicz changed the title generate PINREQ packets on idle input or output. generate PINGREQ packets on idle input or output. Jun 1, 2022
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
source/core_mqtt.c Outdated Show resolved Hide resolved
paulbartell
paulbartell previously approved these changes Jun 1, 2022
paulbartell
paulbartell previously approved these changes Jun 7, 2022
@adam-scislowicz adam-scislowicz force-pushed the adamds/publish_retry_and_pingreq_behavior_changes branch 2 times, most recently from 4b0ff07 to c1ed10b Compare June 10, 2022 16:43
@paulbartell paulbartell force-pushed the adamds/publish_retry_and_pingreq_behavior_changes branch from c1ed10b to 99ec326 Compare June 23, 2022 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants