This commit is contained in:
shoopea 2020-06-14 22:46:23 +02:00
parent 24470f01f1
commit 8486ef37ac

View File

@ -30,14 +30,15 @@ func main() {
p := Packet{}
for {
n, err = r.Read(b[read:])
logErrorDebug(err, "r.Read")
read += n
logInfoDebug("Waiting for packet, read %d bytes.", read)
if read >= 3 {
logInfoDebug("Packet read")
break
}
n, err = r.Read(b[read:])
logErrorDebug(err, "r.Read")
read += n
logInfoDebug("Waiting for packet, read %d bytes.", read)
}
p.PLength = binary.LittleEndian.Uint16(b[0:])
p.PType = b[2]