Hi Frank,
                 
                Thanks for your “immediate” response!
                 
                Sorry, I was too unspecific in my
                    question.
                 
                If I understood it correctly, a
                    keep-alive value of zero, would switch off the
                    broker-sided test for receiving PINGREQ packets to
                    decide, if a connection is alive or should be
                    closed.
                 
                To switch of the PINGREQ test for
                    connection closure at the broker, the client needs
                    to specify the keep-alive interval to be zero.
                But the Mosquitto API allows only a
                    keep-alive interval of five or more seconds.
                 
                I’m with you and I don’t think, that it
                    mostly makes no sense to specify values lower then
                    five, but zero is valid and as a semantic!
                 
                That’s why I’m asking.
                 
                Best regards
                Martin
                 
                
                 
                Keep in
                  mind that the value of zero for Keep Alive is a
                  special indicator to turn it off (i.e. don't use Keep
                  Alive).
                  
                  
                  So don't think of the specs as saying you can "go down
                  to zero". Technically, I guess, a 1-sec Keep Alive
                  should be supported, but practically, this would
                  induce a huge overhead on the broker. If you had ten
                  thousand clients pinging at that rate, it would be
                  hitting the broker with 10k msgs/sec just to maintain
                  otherwise quiet connections.
                  
                  So you will find that many clients won't let you set a
                  Keep Alive of less than 5 or 10, and default to
                  something like 30, 45, or 60.
                  
                  Whether a _client_ is required to support all values
                  1-65535 is debatable. Technically, a _broker_ probably
                  should, to be 100% compliant, but allowing really low
                  values would let some clients put a large burden on
                  the broker.
                  
                  Frank
                
                  On 9/25/23 09:06, Lemburg, Martin
                    via mosquitto-dev wrote:
                 
                
                  Hello,
                   
                  May be a naive question, but why I
                      can only connect with Mosquitto to a broker with a
                      keep-alive greater or equal to 5, while the
                      protocols allow a zero keep-alive?
                   
                  That’s all for the beginning.
                   
                  Best regards
                  Martin
                  
                      
                    
                  _______________________________________________
                  mosquitto-dev mailing list
                  mosquitto-dev@xxxxxxxxxxx
                  To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev