From c4e4b8302d9cb74ed39727d606f567f7ddf61f05 Mon Sep 17 00:00:00 2001 From: Reinhard L Date: Thu, 4 Nov 2021 18:33:38 +0800 Subject: [PATCH] fix ping interval issue --- transport/polling.go | 3 ++- transport/websocket.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/polling.go b/transport/polling.go index ef8c5b9..5f5549a 100644 --- a/transport/polling.go +++ b/transport/polling.go @@ -9,12 +9,13 @@ import ( "time" "fmt" + "github.com/mtfelian/golang-socketio/logging" "github.com/mtfelian/golang-socketio/protocol" ) const ( - PlDefaultPingInterval = 10 * time.Second + PlDefaultPingInterval = 30 * time.Second PlDefaultPingTimeout = 60 * time.Second PlDefaultReceiveTimeout = 60 * time.Second PlDefaultSendTimeout = 60 * time.Second diff --git a/transport/websocket.go b/transport/websocket.go index 73573c9..90c7657 100644 --- a/transport/websocket.go +++ b/transport/websocket.go @@ -14,7 +14,7 @@ import ( const ( upgradeFailed = "Upgrade failed: " - wsDefaultPingInterval = 30 * time.Second + wsDefaultPingInterval = 10 * time.Second wsDefaultPingTimeout = 60 * time.Second wsDefaultReceiveTimeout = 60 * time.Second wsDefaultSendTimeout = 60 * time.Second