vertx-mqtt
vertx-mqtt copied to clipboard
Respecting idleTimeout from MqttServerOptions (for disconnecting inactive clients)
We are implementing a server app based on vertx-mqtt-server. We would like to have a possibility of defining global idle timeout for incoming connections. There already is setIdleTimeout method inherited from TCPSSLOptions, but idleTimeout field is not used while IdleStateHandler is being set. MQTT 3.1.1 spec says: "Note that a Server is permitted to disconnect a Client that it determines to be inactive or non-responsive at any time, regardless of the Keep Alive value provided by that Client." According to the above statement in our opinion the idleTimeout value should have a precedence over keep alive value set by a mqtt client in CONNECT packet. We can prepare a PR if you think that this change is appropriate. Please let us know in the comments.