Beispiel #1
0
func parseUdpHeader(buf *streambuf.Buffer) (mcUdpHeader, error) {
	var h mcUdpHeader
	h.requestId, _ = buf.ReadNetUint16()
	h.seqNumber, _ = buf.ReadNetUint16()
	h.numDatagrams, _ = buf.ReadNetUint16()
	buf.Advance(2) // ignore reserved
	return h, buf.Err()
}