Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep-alive rejection #943

Open
pascaldekloe opened this issue Feb 17, 2025 · 1 comment
Open

Keep-alive rejection #943

pascaldekloe opened this issue Feb 17, 2025 · 1 comment

Comments

@pascaldekloe
Copy link

    // When keep_alive feature is disabled client can live forever, which is not good in
    // distributed broker context so currenlty we don't allow it.
    if connect.keep_alive == 0 {
        return Err(Error::ZeroKeepAlive);
    }

Such behaviour deviates from the 3.1.1 specification:

A Keep Alive value of zero (0) has the effect of turning off the keep alive mechanism. This means that, in this case, the Server is not required to disconnect the Client on the grounds of inactivity.
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.

The server may enforce it's own keep-alive when zero, yet it may not deny clients that wish to abstain from PING obligations.

@pascaldekloe
Copy link
Author

The handle_auth routine before ignores the keep-alive value. How about a sane default of 30 seconds or something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant