修改底层接收
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user