KeepAlive implementation seems incorrect
water-a opened this issue · comments
water-a commented
ticker = time.NewTicker(rc.getKeepAliveTimeout())
...
if err := rc.writeControlPingMessage(); err != nil {
log.Println(err)
}
<-ticker.C
if time.Since(keepAliveResponse.getLastResponse()) > rc.getKeepAliveTimeout() {
rc.CloseAndReconnect()
return
}
Shouldn't time.Since(keepAliveResponse.getLastResponse())
always be greater than keepAliveTimeout because it's waiting on the timer which is set to keepAliveTimeout???
I'm encountering the situation where the time since the last response is ever so slightly longer than keepAliveTimeout.
Nikolay Pavlovich commented