From b75eaf3c161b56cd4bfc99a5e68c2ce3695e87b2 Mon Sep 17 00:00:00 2001 From: Nikolay Pavlovich Date: Thu, 7 Jul 2022 17:25:03 +0300 Subject: [PATCH] fix keepalive simple patch for keepalive on the same host --- recws.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recws.go b/recws.go index 4faa7af..83482bb 100644 --- a/recws.go +++ b/recws.go @@ -409,7 +409,8 @@ func (rc *RecConn) keepAlive() { } <-ticker.C - if time.Since(keepAliveResponse.getLastResponse()) > rc.getKeepAliveTimeout() { + timeoutOffset := time.Millisecond * 10 + if time.Since(keepAliveResponse.getLastResponse()) > rc.getKeepAliveTimeout()+timeoutOffset { rc.CloseAndReconnect() return }