-
Notifications
You must be signed in to change notification settings - Fork 202
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
Unnecessary keepalive frames #66
Comments
can you elaborate? |
Currently this code https://github.com/xtaci/smux/blob/master/session.go#L383 send keepalive frame (cmdNOP) every 10 seconds. So, I suggest start sending keepalive frames (cmdNOP) after the last successful reading of data. The simplest solution is replace https://github.com/xtaci/smux/blob/master/session.go#L384 time.Ticker to time.Timer, and after successful reading cdmPSH reset time.Timer (https://golang.org/pkg/time/#Timer.Reset) ;) |
for receiving only connection, it's necessary to send cmdNOP perodically. only 8 bytes in 10 seconds. |
Maybe you are right and this is overkill :) |
I think, If data is read from a connection, then there is no point in sending a keepalive frame. It is necessary to send the keepalive frame after some timeout from the last read operation. Because success read means that connection is alive, and keepalive frame in this case unnecessary.
The text was updated successfully, but these errors were encountered: