github.com/geph-official/geph2@v0.22.6-0.20210211030601-f527cb59b0df/libs/kcppp/segment.go (about) 1 package kcppp 2 3 const ( 4 cmdPUSH = 81 5 cmdACK = 82 6 cmdWASK = 83 7 cmdWINS = 84 8 cmdSACK = 91 9 cmdRST = 0 10 ) 11 12 type inlineBytes struct { 13 len int 14 raw [2048]byte 15 } 16 17 func (ib *inlineBytes) slice() []byte { 18 return ib.raw[:ib.len] 19 } 20 21 type segHeader struct { 22 ConvID uint32 23 Cmd uint8 24 Rsrv uint8 25 Window uint16 26 Timestamp uint32 27 Seqno uint32 28 Ackno uint32 29 } 30 31 type segment struct { 32 Header segHeader 33 Body inlineBytes 34 }