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

Hello Henrique,
maybe I misunderstood you. However it seems to me that what you mention is not a real problem. It is true that Linux epoll is woken up when an interrupt occurs on the files (devices) it is monitoring. So may happens that interrupts like errors or (as in your case) other events, cause returning from epoll. Nevertheless, if you check the events, you will just see that it is not one of the events you are waiting for and you will "do nothing". At least, this is the way I'm handling my Iot processes in a context very similar to yourst.
Attilio


On Wed, 14 Feb 2024 at 17:40, 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

Back to the top