Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Question about handling keepalive messages with external epoll event loop

Hi,

That should work fine.

Cheers,

Roger

On Wed, 14 Feb 2024 at 17:50, Henrique Marks via mosquitto-dev
<mosquitto-dev@xxxxxxxxxxx> wrote:
>
> Hello!
>
> In that case I just added some timeout to epoll_wait call (in milliseconds, so KEEPALIVE * 1000) and just call mosquitto_loop_misc(mosq) just before going to wait again.
>
> It seems to work fine!
>
> Thanks !
>
> With kind regards, Henrique Marks
>
> On Wed, 14 Feb 2024 at 18:11, Tobias Assarsson via mosquitto-dev <mosquitto-dev@xxxxxxxxxxx> wrote:
>>
>> Hello!
>>
>> it looks like you need to periodically call mosquitto_loop_misc for pings to be handled.
>> https://mosquitto.org/api/files/mosquitto-h.html#mosquitto_loop_misc
>>
>> On Wed, Feb 14, 2024 at 5:40 PM Henrique Marks via mosquitto-dev <mosquitto-dev@xxxxxxxxxxx> wrote:
>>>
>>> Hello all,
>>>
>>> I have a single thread application that implements its own event loop with epoll. It implements reading from some devices, and publishes mqtt messages based on the values read.
>>>
>>> So epoll monitors file descriptors from the devices managed and mosquitto file descriptor.
>>>
>>> This is all fairly standard, but I have a problem that the application disconnects after the keepalive time, and the question is how to handle keepalive messages in an external epoll managed event-loop ?
>>>
>>> if someone has worked out that use-case OR can point me to testcode or documentation about that it would be nice.
>>>
>>> Thanks in advance, Henrique Marks
>>>
>>>
>>> --
>>> Henrique Marks
>>> henriquemarks@xxxxxxxxx
>>> cel: +31 6 19307402
>>> _______________________________________________
>>> mosquitto-dev mailing list
>>> mosquitto-dev@xxxxxxxxxxx
>>> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev
>>
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx
>> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev
>
>
>
> --
> Henrique Marks
> henriquemarks@xxxxxxxxx
> cel: +31 6 19307402
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top