From f185c981f764881d15354a0097793b251b44577a Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Tue, 5 Nov 2024 16:24:07 +0800 Subject: [PATCH] feat: support text ping pong --- internal/msggateway/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/msggateway/client.go b/internal/msggateway/client.go index 99598d521..48cbf2b6a 100644 --- a/internal/msggateway/client.go +++ b/internal/msggateway/client.go @@ -438,6 +438,9 @@ func (c *Client) handlerTextMessage(b []byte) error { if err != nil { return err } + if err := c.conn.SetWriteDeadline(writeWait); err != nil { + return err + } return c.conn.WriteMessage(MessageText, msgData) default: return fmt.Errorf("not support message type %s", msg.Type)