kone-net/go-chat

升级为websocket协议时等待了4分钟,从而ws链接失败

Jeffery0 opened this issue · 0 comments

conn, err := upGrader.Upgrade(c.Writer, c.Request, nil) //1
if err != nil {
retrun
}
messageType, message, err := conn.ReadMessage() //2
if err != nil {
lg.Debug("conn.ReadMessage err:", err, ", messageType:", messageType)
return
}
错误:time="2023-07-06T19:10:17+08:00" level=debug msg="conn.ReadMessage err:read tcp 127.0.0.1:8080->127.0.0.1:54657: wsarecv: An established connection was aborted by the software in your host machine., messageType:-1"
从1到2等待了4min, 请问是什么原因?