mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-04 19:32:17 +08:00
add debug log in writePongMsg.
This commit is contained in:
parent
1b56405fe8
commit
1e0d74f911
@ -107,7 +107,6 @@ func (c *Client) pingHandler(appData string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.ZDebug(c.ctx, "ping Handler Success.", "appData", appData)
|
log.ZDebug(c.ctx, "ping Handler Success.", "appData", appData)
|
||||||
|
|
||||||
return c.writePongMsg(appData)
|
return c.writePongMsg(appData)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,17 +391,24 @@ func (c *Client) writePingMsg() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) writePongMsg(appData string) error {
|
func (c *Client) writePongMsg(appData string) error {
|
||||||
|
log.ZDebug(c.ctx, "write Pong Msg in Server", "appData", appData)
|
||||||
if c.closed.Load() {
|
if c.closed.Load() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.ZDebug(c.ctx, "write Pong Msg in Server", "appData", appData)
|
||||||
c.w.Lock()
|
c.w.Lock()
|
||||||
defer c.w.Unlock()
|
defer c.w.Unlock()
|
||||||
|
|
||||||
|
log.ZDebug(c.ctx, "write Pong Msg in Server", "appData", appData)
|
||||||
err := c.conn.SetWriteDeadline(writeWait)
|
err := c.conn.SetWriteDeadline(writeWait)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return errs.Wrap(err)
|
||||||
|
}
|
||||||
|
err = c.conn.WriteMessage(PongMessage, []byte(appData))
|
||||||
|
if err != nil {
|
||||||
|
log.ZError(c.ctx, "Write Message is error", errs.Wrap(err), "Pong msg", PongMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.conn.WriteMessage(PongMessage, []byte(appData))
|
return errs.Wrap(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user