LKcp.lkcp_create(session, func)
session: number mark session
func: extra closures, which KCP layer invoke callback to send data, see detail in testkcp.lua
kcp:lkcp_wndsize(sndwnd, rcvwnd)
Set maximum window size: sndwnd=32, rcvwnd=32 by default
sndwnd: send window size
rcvwnd: recive window size
kcp:lkcp_nodelay(nodelay, interval, resend, nc)
Config re-transmission and flow control
nodelay: 0:disable(default), 1:enable
interval: internal update timer interval in millisec, default is 100ms
resend: 0:disable fast resend(default), 1:enable fast resend
nc: 0:normal congestion control(default), 1:disable congestion control
Get when to invoke lkcp_update
current: current timestamp in millisec
when: timestamp in millisec when to invoke lkcp_update
Update state (call it repeatedly, every 10ms-100ms), or you can ask
current: current timestamp in millisec
sent_len: below zero for error, otherwise succeed
When you received a low level packet (eg. UDP packet), call it
data: data received from transport layer
ret: below zero for error, otherwise succeed
rcv_len: Less than or equal to 0 for EAGAIN, otherwise for rcv_len
rcv_buf: if rcv_len greater than 0, rcv_buf is data to recv