修改底层接收

This commit is contained in:
1
2025-10-06 07:28:46 +00:00
parent 63b7699c56
commit 99ee6c2a7f

View File

@@ -126,7 +126,12 @@ func (s *Server) OnTraffic(c gnet.Conn) (action gnet.Action) {
s.parser(c, msg.Payload)
})
}
if c.InboundBuffered() > 0 {
if err := c.Wake(nil); err != nil { // wake up the connection manually to avoid missing the leftover data
logging.Errorf("failed to wake up the connection, %v", err)
return gnet.Close
}
}
return gnet.None
}