libwebsockets icon indicating copy to clipboard operation
libwebsockets copied to clipboard

mqtt: fix MQTT client PINGREQ failure when using LIBUV as event driver.

Open baldwin-law opened this issue 1 year ago • 2 comments

When libuv is used as the underlying event-driven mechanism, the keepalive operation between the MQTT client and the server fails. The reason is that the keepalive operation should send a PINGREQ, but in fact, it is not sent. The problem lies in the fact that the modification of the underlying I-O-related events is not triggered, resulting in the inability to trigger I/O events. Through testing, modifying the mux_substream flag can solve this problem.

baldwin-law avatar Nov 05 '24 08:11 baldwin-law

Thanks... does it make trouble to change the test to a runtime one like if (lws_check_opt(context->options, LWS_SERVER_OPTION_LIBUV)) ? The reason is it's possible to build lws with the LIBUV config, but actually select some other event loop at runtime.

lws-team avatar Nov 08 '24 07:11 lws-team

Of course, your approach is more elegant. I'll push the changes.

baldwin-law avatar Nov 12 '24 13:11 baldwin-law