Start message processing earlier.

This commit is contained in:
Joachim Bauch 2023-01-19 15:56:04 +01:00
parent 20228b176f
commit e9f80c6b4d
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02

View file

@ -248,6 +248,8 @@ func (c *Client) ReadPump() {
c.Close()
}()
go c.processMessages()
addr := c.RemoteAddr()
c.mu.Lock()
conn := c.conn
@ -279,8 +281,6 @@ func (c *Client) ReadPump() {
return nil
})
go c.processMessages()
for {
conn.SetReadDeadline(time.Now().Add(pongWait)) // nolint
messageType, reader, err := conn.NextReader()