Skip to content

kcp2k::Kcp

Public Functions

Name
Kcp(uint conv, Action< byte[], int > output)
int Receive(byte [] buffer, int len)
int PeekSize()
int Send(byte [] buffer, int offset, int len)
int Input(byte [] data, int size)
used when you receive a low level packet (eg. UDP packet)
void Flush()
void Update(uint currentTimeMilliSeconds)
uint Check(uint current_)
void SetMtu(uint mtu)
void SetInterval(uint interval)
void SetNoDelay(uint nodelay, uint interval =INTERVAL, int resend =0, bool nocwnd =false)
void SetWindowSize(uint sendWindow, uint receiveWindow)

Public Attributes

Name
const int RTO_NDL
const int RTO_MIN
const int RTO_DEF
const int RTO_MAX
const int CMD_PUSH
const int CMD_ACK
const int CMD_WASK
const int CMD_WINS
const int ASK_SEND
const int ASK_TELL
const int WND_SND
const int WND_RCV
const int MTU_DEF
const int ACK_FAST
const int INTERVAL
const int OVERHEAD
const int DEADLINK
const int THRESH_INIT
const int THRESH_MIN
const int PROBE_INIT
const int PROBE_LIMIT
const int FASTACK_LIMIT
int WaitSnd

Public Functions Documentation

function Kcp

inline Kcp(
    uint conv,
    Action< byte[], int > output
)

function Receive

inline int Receive(
    byte [] buffer,
    int len
)

function PeekSize

inline int PeekSize()

function Send

inline int Send(
    byte [] buffer,
    int offset,
    int len
)

function Input

inline int Input(
    byte [] data,
    int size
)

used when you receive a low level packet (eg. UDP packet)

function Flush

inline void Flush()

function Update

inline void Update(
    uint currentTimeMilliSeconds
)

function Check

inline uint Check(
    uint current_
)

function SetMtu

inline void SetMtu(
    uint mtu
)

function SetInterval

inline void SetInterval(
    uint interval
)

function SetNoDelay

inline void SetNoDelay(
    uint nodelay,
    uint interval =INTERVAL,
    int resend =0,
    bool nocwnd =false
)

function SetWindowSize

inline void SetWindowSize(
    uint sendWindow,
    uint receiveWindow
)

Public Attributes Documentation

variable RTO_NDL

const int RTO_NDL = 30;

variable RTO_MIN

const int RTO_MIN = 100;

variable RTO_DEF

const int RTO_DEF = 200;

variable RTO_MAX

const int RTO_MAX = 60000;

variable CMD_PUSH

const int CMD_PUSH = 81;

variable CMD_ACK

const int CMD_ACK = 82;

variable CMD_WASK

const int CMD_WASK = 83;

variable CMD_WINS

const int CMD_WINS = 84;

variable ASK_SEND

const int ASK_SEND = 1;

variable ASK_TELL

const int ASK_TELL = 2;

variable WND_SND

const int WND_SND = 32;

variable WND_RCV

const int WND_RCV = 128;

variable MTU_DEF

const int MTU_DEF = 1200;

variable ACK_FAST

const int ACK_FAST = 3;

variable INTERVAL

const int INTERVAL = 100;

variable OVERHEAD

const int OVERHEAD = 24;
const int DEADLINK = 20;

variable THRESH_INIT

const int THRESH_INIT = 2;

variable THRESH_MIN

const int THRESH_MIN = 2;

variable PROBE_INIT

const int PROBE_INIT = 7000;

variable PROBE_LIMIT

const int PROBE_LIMIT = 120000;

variable FASTACK_LIMIT

const int FASTACK_LIMIT = 5;

variable WaitSnd

int WaitSnd => snd_buf.Count + snd_queue.Count;

Updated on 24 January 2021 at 23:47:12 UTC