bug repair when high concurrent

This commit is contained in:
刘河
2019-02-18 01:05:05 +08:00
parent 48c7309973
commit dab51c32a2
14 changed files with 229 additions and 242 deletions

View File

@@ -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