Force client keepAliveTimeout #865
-
Hi, is it possibile to force a client keep alive timeout? Some clients don't set correctly their keep alive timeout, so their client instance remains into the broker memory even if the device is switched off for a long time. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Actually there is no support for this, anyway you can access to clients instances from The keep alive interval is set from the connect packet If you think that this is a bug in aedes could you consider submitting a PR to fix it? This could cause memory leaks if client instances are not removed |
Beta Was this translation helpful? Give feedback.
Actually there is no support for this, anyway you can access to clients instances from
broker.clients
that is an object where key is client id and value is the client instance, when a client connects we set a keepAliveTimeout that is rescheduled every time a packet is received from client: https://github.com/moscajs/aedes/blob/main/lib/handlers/index.js#L65C1-L65C1The keep alive interval is set from the connect packet
keepAlive
timeout as shown in the first link.If you think that this is a bug in aedes could you consider submitting a PR to fix it? This could cause memory leaks if client instances are not removed