Skip to content

Commit 727d9d5

Browse files
committed
mqtt-sub: do not treat MQTT_CODE_CONTINUE as error in non-blocking read loop
1 parent 1963584 commit 727d9d5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

examples/pub-sub/mqtt-sub.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,13 @@ int sub_client(MQTTCtx *mqttCtx)
527527
break;
528528
}
529529
}
530+
#ifdef WOLFMQTT_NONBLOCK
531+
else if (rc == MQTT_CODE_CONTINUE) {
532+
/* Non-blocking: no data yet, keep polling. mqtt_check_timeout()
533+
* above will convert this to MQTT_CODE_ERROR_TIMEOUT after the
534+
* inactivity window, which drives the keep-alive ping branch. */
535+
}
536+
#endif
530537
else if (rc != MQTT_CODE_SUCCESS) {
531538
/* There was an error */
532539
PRINTF("MQTT Message Wait: %s (%d)",

0 commit comments

Comments
 (0)