mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
bug repair when high concurrent
This commit is contained in:
@@ -89,11 +89,9 @@ func (s *Conn) ReadLen(cLen int) ([]byte, error) {
|
||||
|
||||
//read length or id (content length=4)
|
||||
func (s *Conn) GetLen() (int, error) {
|
||||
val, err := s.ReadLen(4)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return GetLenByBytes(val)
|
||||
var l int32
|
||||
err := binary.Read(s, binary.LittleEndian, &l)
|
||||
return int(l), err
|
||||
}
|
||||
|
||||
//read flag
|
||||
|
Reference in New Issue
Block a user