From 58a237e383b6b9dd5158ddde5f28189fccdbe65a Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 9 Apr 2024 09:41:56 +0200 Subject: [PATCH 1/2] Remove useless calculation More readable this way and also a few cycles faster. --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 18814d7..de98cbd 100644 --- a/config.go +++ b/config.go @@ -16,7 +16,7 @@ func newConfig() *Config { return &Config{ WriteWait: 10 * time.Second, PongWait: 60 * time.Second, - PingPeriod: (60 * time.Second * 9) / 10, + PingPeriod: 57 * time.Second, MaxMessageSize: 512, MessageBufferSize: 256, } From 96355c8edf48004cb8a2a5d3f1b5ede74634d1a1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 9 Apr 2024 09:42:55 +0200 Subject: [PATCH 2/2] Update config.go --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index de98cbd..82aa3d9 100644 --- a/config.go +++ b/config.go @@ -16,7 +16,7 @@ func newConfig() *Config { return &Config{ WriteWait: 10 * time.Second, PongWait: 60 * time.Second, - PingPeriod: 57 * time.Second, + PingPeriod: 54 * time.Second, MaxMessageSize: 512, MessageBufferSize: 256, }