|
|
@ -101,7 +101,7 @@ func (c *Connection) StartReader() { |
|
|
|
|
|
|
|
//读取客户端的Msg head
|
|
|
|
headData := make([]byte, dp.GetHeadLen()) |
|
|
|
if _, err := io.ReadFull(c.GetTCPConnection(), headData); err != nil { |
|
|
|
if _, err := io.ReadFull(c.Conn, headData); err != nil { |
|
|
|
fmt.Println("read msg head error ", err) |
|
|
|
break |
|
|
|
} |
|
|
@ -118,7 +118,7 @@ func (c *Connection) StartReader() { |
|
|
|
var data []byte |
|
|
|
if msg.GetDataLen() > 0 { |
|
|
|
data = make([]byte, msg.GetDataLen()) |
|
|
|
if _, err := io.ReadFull(c.GetTCPConnection(), data); err != nil { |
|
|
|
if _, err := io.ReadFull(c.Conn, data); err != nil { |
|
|
|
fmt.Println("read msg data error ", err) |
|
|
|
break |
|
|
|
} |
|
|
|