ikcp

package
v0.0.0-...-cf76086 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const IKCP_ACK_FAST uint32 = 3
View Source
const IKCP_ASK_SEND uint32 = 1 // need to send IKCP_CMD_WASK
View Source
const IKCP_ASK_TELL uint32 = 2 // need to send IKCP_CMD_WINS
View Source
const IKCP_CMD_ACK uint32 = 82 // cmd: ack
View Source
const IKCP_CMD_PUSH uint32 = 81 // cmd: push data
View Source
const IKCP_CMD_WASK uint32 = 83 // cmd: window probe (ask)
View Source
const IKCP_CMD_WINS uint32 = 84 // cmd: window size (tell)
View Source
const IKCP_DEADLINK uint32 = 10
View Source
const IKCP_INTERVAL uint32 = 100
View Source
const IKCP_LOG_INPUT = 2
View Source
const IKCP_LOG_IN_ACK = 32
View Source
const IKCP_LOG_IN_DATA = 16
View Source
const IKCP_LOG_IN_PROBE = 64
View Source
const IKCP_LOG_IN_WIN = 128
View Source
const IKCP_LOG_OUTPUT = 1
View Source
const IKCP_LOG_OUT_ACK = 512
View Source
const IKCP_LOG_OUT_DATA = 256
View Source
const IKCP_LOG_OUT_PROBE = 1024
View Source
const IKCP_LOG_OUT_WINS = 2048
View Source
const IKCP_LOG_RECV = 8
View Source
const IKCP_LOG_SEND = 4
View Source
const IKCP_MTU_DEF uint32 = 1400
View Source
const IKCP_OVERHEAD uint32 = 24
View Source
const IKCP_PROBE_INIT uint32 = 7000 // 7 secs to probe window size
View Source
const IKCP_PROBE_LIMIT uint32 = 120000 // up to 120 secs to probe window
View Source
const IKCP_RTO_DEF uint32 = 200
View Source
const IKCP_RTO_MAX uint32 = 60000
View Source
const IKCP_RTO_MIN uint32 = 100 // normal min rto
View Source
const IKCP_RTO_NDL uint32 = 30 // no delay min rto

===================================================================== KCP BASIC =====================================================================

View Source
const IKCP_THRESH_INIT uint32 = 2
View Source
const IKCP_THRESH_MIN uint32 = 2
View Source
const IKCP_WND_RCV uint32 = 32
View Source
const IKCP_WND_SND uint32 = 32

Variables

This section is empty.

Functions

func Ikcp_check

func Ikcp_check(kcp *Ikcpcb, current uint32) uint32

func Ikcp_flush

func Ikcp_flush(kcp *Ikcpcb)

--------------------------------------------------------------------- Ikcp_flush ---------------------------------------------------------------------

func Ikcp_input

func Ikcp_input(kcp *Ikcpcb, data []byte, size int) int

--------------------------------------------------------------------- input data ---------------------------------------------------------------------

func Ikcp_log

func Ikcp_log(kcp *Ikcpcb, mask int32, head string, args ...interface{})

write log

func Ikcp_nodelay

func Ikcp_nodelay(kcp *Ikcpcb, nodelay, interval, resend, nc int32) int32

func Ikcp_peeksize

func Ikcp_peeksize(kcp *Ikcpcb) int32

--------------------------------------------------------------------- send data ---------------------------------------------------------------------

func Ikcp_recv

func Ikcp_recv(kcp *Ikcpcb, buffer []byte, _len int32) int32

--------------------------------------------------------------------- recv data ---------------------------------------------------------------------

func Ikcp_release

func Ikcp_release(kcp *Ikcpcb)

--------------------------------------------------------------------- release a new kcpcb ---------------------------------------------------------------------

func Ikcp_send

func Ikcp_send(kcp *Ikcpcb, buffer []byte, _len int) int

--------------------------------------------------------------------- send data ---------------------------------------------------------------------

func Ikcp_setmtu

func Ikcp_setmtu(kcp *Ikcpcb, mtu int32) int32

func Ikcp_update

func Ikcp_update(kcp *Ikcpcb, current uint32)

--------------------------------------------------------------------- input update ---------------------------------------------------------------------

func Ikcp_update_ack

func Ikcp_update_ack(kcp *Ikcpcb, rtt int32)

--------------------------------------------------------------------- parse ack ---------------------------------------------------------------------

func Ikcp_waitsnd

func Ikcp_waitsnd(kcp *Ikcpcb) int32

func Ikcp_wndsize

func Ikcp_wndsize(kcp *Ikcpcb, sndwnd, rcvwnd int32) int32

Types

type DelayPacket

type DelayPacket struct {
	// contains filtered or unexported fields
}

func (*DelayPacket) Init

func (p *DelayPacket) Init(size int, src []byte)

type DelayTunnel

type DelayTunnel struct{ *list.List }

type IKCPCB

type IKCPCB struct {
	Output func(buf []byte, _len int32, kcp *Ikcpcb, user interface{}) int32
	// contains filtered or unexported fields
}

=====================================================================

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.

===================================================================== --------------------------------------------------------------------- IKCPCB ---------------------------------------------------------------------

type IKCPSEG

type IKCPSEG struct {
	// contains filtered or unexported fields
}

--------------------------------------------------------------------- manage segment ---------------------------------------------------------------------

type Ikcpcb

type Ikcpcb struct{ IKCPCB }

func Ikcp_create

func Ikcp_create(conv uint32, user interface{}) *Ikcpcb

--------------------------------------------------------------------- create a new kcpcb ---------------------------------------------------------------------

type LatencySimulator

type LatencySimulator struct {
	// contains filtered or unexported fields
}

func (*LatencySimulator) Init

func (p *LatencySimulator) Init(lostrate, rttmin, rttmax, nmax int)

lostrate: 往返一周丢包率的百分比,默认 10% rttmin:rtt最小值,默认 60 rttmax:rtt最大值,默认 125 func (p *LatencySimulator)Init(int lostrate = 10, int rttmin = 60, int rttmax = 125, int nmax = 1000):

type Random

type Random *rand.Rand

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL