From 556f938c8d3a2a075cf73d93da11f3771bf96a25 Mon Sep 17 00:00:00 2001 From: aceld Date: Wed, 24 Apr 2019 18:35:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=96=B9=E6=B3=95=E8=B0=83?= =?UTF-8?q?=E7=94=A8GetTcpConnetion=E6=94=B9=E4=B8=BA=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=8F=96=E5=B1=9E=E6=80=A7c.Conn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- znet/connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/znet/connection.go b/znet/connection.go index ee772f0..cdfe0e7 100644 --- a/znet/connection.go +++ b/znet/connection.go @@ -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 }