feat: implement server-initiated heartbeat in msgGateway module (#2404)

* feat: implement send ping msg when platform is web in gateway.

* add context life cycle control.

* feat: implement heartbeat logic in msggateway.

* update heartbeat logic.

* update to correct method name and comment.

* update initiate heartbeat logic.

* rename ws_server

* update writePingMsg logic

* update log level to warn.
This commit is contained in:
Monet Lee
2024-07-10 15:48:12 +08:00
committed by GitHub
parent 213613cf54
commit 28898f5b79
4 changed files with 58 additions and 1 deletions
+3
View File
@@ -53,6 +53,9 @@ const (
// Time allowed to read the next pong message from the peer.
pongWait = 30 * time.Second
// Send pings to peer with this period. Must be less than pongWait.
pingPeriod = (pongWait * 9) / 10
// Maximum message size allowed from peer.
maxMessageSize = 51200
)