secs_since_valid_ping max value
When I set the interval secs_since_valid_ping to 0xffff, I keep reconnecting. Why?
You can set the conceal count to LWS_RETRY_CONCEAL_ALWAYS which is 0xffff. But the secs_since_valid_ping doesn't particularly understand 0xffff (it's a uint16_t). Assuming you mean it is constantly disconnecting under those conditions, does the problem still come with 0x7fff or 0x8000?
Only when it is set to 0xffff will the connection be disconnected. Other values are fine. Moreover, the definition of LWS_RETRY_CONCEAL_ALWAYS is 0xffff. I guess it might be related to the parameter secs_since_valid_hangup. How should I set these two parameters?
I guess it might be related to the parameter secs_since_valid_hangup
No, as I said
You can set the conceal count to LWS_RETRY_CONCEAL_ALWAYS which is 0xffff
That is related to how many times it should try to reconnect before failing... for that member, 0xffff means never "fail" but keep retrying forever.
Why 0xffff has a bad effect for the secs_since_valid_ping I dunno. But you can just use 0xfffe and all is well according to what I understood, so is it a problem?
I found that in my code secs_since_valid_hangup is secs_since_valid_ping fixed plus 10, and when set to 0xffff, it is reversed, so I should avoid setting the size of secs_since_valid_ping greater than 0xfff5. Also, when I set the "conceal count" parameter to LWS_RETOMY_CONCEAL_ALWAYS, as you said, no disconnection will occur.