format pong handler

This commit is contained in:
in-void 2023-04-11 23:38:12 +02:00
parent 57ba3cf4fb
commit 71f700f075

View File

@ -57,7 +57,11 @@ func (c *Client) readPump() {
c.conn.SetReadLimit(maxMessageSize) c.conn.SetReadLimit(maxMessageSize)
c.conn.SetReadDeadline(time.Now().Add(pongWait)) c.conn.SetReadDeadline(time.Now().Add(pongWait))
c.conn.SetPongHandler(func(string) error { c.conn.SetReadDeadline(time.Now().Add(pongWait)); return nil }) c.conn.SetPongHandler(func(string) error {
c.conn.SetReadDeadline(time.Now().Add(pongWait))
return nil
})
for { for {
_, message, err := c.conn.ReadMessage() _, message, err := c.conn.ReadMessage()