idleTimeout property doesn't work for values less than 6 seconds #396
-
Hello @alexhultman
Seem like it works with values that greater than 5. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
The granularity of timeouts is 4 seconds |
Beta Was this translation helpful? Give feedback.
-
It means that |
Beta Was this translation helpful? Give feedback.
-
@alexander-torosh as described in this issue #286 (comment) the idleTimeout number rounds to the nearest 4 seconds, so setting idleTimeout to anywhere from 2 and less than 6 rounds to 4. Anywhere from 6 to less than 10 rounds to 8, etc. If the client is idle anywhere from that number and 4 less than that number it could trigger the |
Beta Was this translation helpful? Give feedback.
-
I think it might make more sense if the idleTimeout is changed to indicate an idle client time of between that number and Plus 4 seconds instead of Minus 4 seconds. So setting an idleTimeout of 4 seconds means idle client from 4 to 8 seconds gets closed, and idleTimeout of 8 means from 8 to 12 seconds gets closed. Because it usually uses the lower range to close the connection, which is 4 seconds less than what people think they are getting when setting idleTimeout. As long as people understand what is going on it doesn't matter but it might be easier if is changed or better documented |
Beta Was this translation helpful? Give feedback.
-
I don't remember the exact rules here but I'm pretty sure this is correct. Timeouts are not meant to be accurate. |
Beta Was this translation helpful? Give feedback.
@alexander-torosh as described in this issue #286 (comment) the idleTimeout number rounds to the nearest 4 seconds, so setting idleTimeout to anywhere from 2 and less than 6 rounds to 4. Anywhere from 6 to less than 10 rounds to 8, etc. If the client is idle anywhere from that number and 4 less than that number it could trigger the
close
event. So idleTimeout of 4 is bad because any client idle time between 0 and 4 could trigger theclose
event so it closes immediately. You need at least idleTimeout of 8 to work, where any idle client time from 4 to 8 seconds could trigger theclose
event. In that case you want to send Ping messages at least every 3 seconds. I use idleTimeout of 16, which…