You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs say "SetKeepAlive will set the amount of time (in seconds)"
I was looking at my callsite, which was
options.SetKeepAlive(60)
Looking at the comment, you'd think this would set the keep alive to 60 seconds. But it does not. It sets the keepalive to 60 nanoseconds.... (which gets rounded down to 0, so no keepalive). That's kind of a big difference.
Remove "(in seconds)" from the doc string, or clarify that it will be rounded down to the nearest second... but don't say it's in seconds, because it's not. It's a time.Duration, which is fine, but very different.
The text was updated successfully, but these errors were encountered:
At some point in the past these functions probably did take ints and assumed those
values would relate to the number of seconds for these features. They were changed
to take a time.Duration but the docs were not updated.
resolveseclipse-paho#152
https://godoc.org/github.com/eclipse/paho.mqtt.golang#ClientOptions.SetKeepAlive
The docs say "SetKeepAlive will set the amount of time (in seconds)"
I was looking at my callsite, which was
Looking at the comment, you'd think this would set the keep alive to 60 seconds. But it does not. It sets the keepalive to 60 nanoseconds.... (which gets rounded down to 0, so no keepalive). That's kind of a big difference.
Remove "(in seconds)" from the doc string, or clarify that it will be rounded down to the nearest second... but don't say it's in seconds, because it's not. It's a time.Duration, which is fine, but very different.
The text was updated successfully, but these errors were encountered: