test
This commit is contained in:
parent
11c8aee2d4
commit
24470f01f1
12
main.go
12
main.go
@ -46,19 +46,21 @@ func main() {
|
||||
break
|
||||
}
|
||||
|
||||
logInfoDebug("Waiting for full packet : len : %d / type : %d", p.PLength, p.PType)
|
||||
logInfoDebug("Waiting for packet data : len : %d / type : %d", p.PLength, p.PType)
|
||||
|
||||
for {
|
||||
if read >= int(p.PLength) {
|
||||
logInfoDebug("Data read")
|
||||
break
|
||||
}
|
||||
n, err = r.Read(b[read:])
|
||||
logErrorDebug(err, "r.Read")
|
||||
read += n
|
||||
logInfoDebug("Waiting for data, read %d/%d bytes.", read, p.PLength)
|
||||
if read >= int(p.PLength) {
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
logInfoDebug("Packet read : len : %d / type : %d", p.PLength, p.PType)
|
||||
logInfoDebug("Packet fully read : len : %d / type : %d", p.PLength, p.PType)
|
||||
c := make([]byte, 0xFFFF)
|
||||
copy(c, b[p.PLength:])
|
||||
b = c
|
||||
|
Loading…
Reference in New Issue
Block a user