Documentation ¶
Overview ¶
=====================================================================
KCP - A Better ARQ Protocol Implementation skywind3000 (at) gmail.com, 2010-2011
Features: + Average RTT reduce 30% - 40% vs traditional ARQ like tcp. + Maximum RTT reduce three times vs tcp. + Lightweight, distributed as a single source file.
=====================================================================
Index ¶
- Constants
- type IKCPSEG
- type Ikcpcb
- func (kcp *Ikcpcb) Check(current uint32) uint32
- func (kcp *Ikcpcb) Flush()
- func (kcp *Ikcpcb) Input(data []byte, size int) int
- func (kcp *Ikcpcb) Interval(interval int32) int32
- func (kcp *Ikcpcb) Nodelay(nodelay, interval, resend, nc int32) int32
- func (kcp *Ikcpcb) Peeksize() int32
- func (kcp *Ikcpcb) Recv(buffer []byte, _len int32) int32
- func (kcp *Ikcpcb) Release()
- func (kcp *Ikcpcb) Send(buffer []byte, _len int) int
- func (kcp *Ikcpcb) Setmtu(mtu int32) int32
- func (kcp *Ikcpcb) Update(current uint32)
- func (kcp *Ikcpcb) UpdateAck(rtt int32)
- func (kcp *Ikcpcb) Waitsnd() int32
- func (kcp *Ikcpcb) Wndsize(sndwnd, rcvwnd int32) int32
Constants ¶
View Source
const ( RTO_NDL uint32 = 30 // no delay min rto RTO_MIN uint32 = 100 // normal min rto RTO_DEF uint32 = 200 RTO_MAX uint32 = 60000 CMD_PUSH uint32 = 81 // cmd: push data CMD_ACK uint32 = 82 // cmd: ack CMD_WASK uint32 = 83 // cmd: window probe (ask) CMD_WINS uint32 = 84 // cmd: window size (tell) ASK_SEND uint32 = 1 // need to send CMD_WASK ASK_TELL uint32 = 2 // need to send CMD_WINS WND_SND uint32 = 32 WND_RCV uint32 = 32 MTU_DEF uint32 = 1400 ACK_FAST uint32 = 3 INTERVAL uint32 = 100 OVERHEAD uint32 = 24 DEADLINK uint32 = 10 THRESH_INIT uint32 = 2 THRESH_MIN uint32 = 2 PROBE_INIT uint32 = 7000 // 7 secs to probe window size PROBE_LIMIT uint32 = 120000 // up to 120 secs to probe window )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.