diff --git a/client/client.go b/client/client.go index b2a8c00..55ca858 100644 --- a/client/client.go +++ b/client/client.go @@ -104,6 +104,7 @@ ReadLoop: } if len(leftdata) > 0 { // some data left for processing data = append(leftdata, data...) + leftdata = nil } for { l := len(data) diff --git a/client/common.go b/client/common.go index ad47936..e520bf0 100644 --- a/client/common.go +++ b/client/common.go @@ -5,7 +5,7 @@ const ( // queue size queueSize = 8 // read buffer size - bufferSize = 1024 + bufferSize = 8192 // min packet length minPacketLength = 12