bring kcp over vp8 (#160)
* bring kcp over vp8 for wbstream * add multitrack kcp * make kcp configurable param * fix lingered kcp tunnel after switch into raw vp8 tunnel * add reliable setting into ios and desktop joiners
This commit is contained in:
1 parent
99e5630f19
commit
a0229885ca
50 files changed
+1503
-96
No files matched your search
@@ -71,6 +71,14 @@ func EncodeFrame(connID uint32, msgType byte, payload []byte) []byte {
|
||||
return buf
|
||||
}
|
||||
|
||||
func LooksLikeRelayFrame(payload []byte) bool {
|
||||
if len(payload) < 9 {
|
||||
return false
|
||||
}
|
||||
frameLen := binary.BigEndian.Uint32(payload[0:4])
|
||||
return frameLen >= 5 && int(frameLen)+4 <= len(payload)
|
||||
}
|
||||
|
||||
func DecodeFrames(data []byte, cb func(connID uint32, msgType byte, payload []byte)) {
|
||||
for len(data) >= 4 {
|
||||
frameLen := int(binary.BigEndian.Uint32(data[0:4]))
|
||||
|
||||
Reference in new issue
Block a user