test
This commit is contained in:
parent
24470f01f1
commit
8486ef37ac
9
main.go
9
main.go
@ -30,14 +30,15 @@ func main() {
|
|||||||
p := Packet{}
|
p := Packet{}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
n, err = r.Read(b[read:])
|
|
||||||
logErrorDebug(err, "r.Read")
|
|
||||||
read += n
|
|
||||||
logInfoDebug("Waiting for packet, read %d bytes.", read)
|
|
||||||
if read >= 3 {
|
if read >= 3 {
|
||||||
logInfoDebug("Packet read")
|
logInfoDebug("Packet read")
|
||||||
break
|
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.PLength = binary.LittleEndian.Uint16(b[0:])
|
||||||
p.PType = b[2]
|
p.PType = b[2]
|
||||||
|
Loading…
Reference in New Issue
Block a user