diff --git a/common/socket/ServerEvent.go b/common/socket/ServerEvent.go index 12d8c489..db389bdc 100644 --- a/common/socket/ServerEvent.go +++ b/common/socket/ServerEvent.go @@ -2,6 +2,7 @@ package socket import ( "context" + "encoding/hex" "fmt" "log" "os" @@ -165,7 +166,8 @@ func (s *Server) handleTcp(conn gnet.Conn) (action gnet.Action) { if conn.InboundBuffered() > 0 { t, _ := conn.Peek(conn.InboundBuffered()) - fmt.Println("剩余数据", conn.InboundBuffered(), string(t)) + + fmt.Println("剩余数据", conn.InboundBuffered(), hex.EncodeToString(t)) if err := conn.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