Struct kcp::Kcp[][src]

pub struct Kcp<Output: Write> { /* fields omitted */ }

KCP control

Methods

impl<Output: Write> Kcp<Output>
[src]

Creates a KCP control object, conv must be equal in both endpoints in one connection. output is the callback object for writing.

conv represents conversation.

Creates a KCP control object in stream mode, conv must be equal in both endpoints in one connection. output is the callback object for writing.

conv represents conversation.

Check buffer size without actually consuming it

Receive data from buffer

Send bytes into buffer

Get conv from the next input call

Check if Kcp is waiting for the next input

Set conv value

Get conv

Call this when you received a packet from raw connection

Flush pending ACKs

Flush pending data in buffer.

Update state every 10ms ~ 100ms.

Or you can ask check when to call this again.

Determine when you should call update. Return when you should invoke update in millisec, if there is no input/send calling. You can call update in that time without calling it repeatly.

Change MTU size, default is 1400

MTU = Maximum Transmission Unit

Get MTU

Set check interval

Set nodelay

fastest config: nodelay(true, 20, 2, true)

nodelay: default is disable (false) interval: internal update timer interval in millisec, default is 100ms resend: 0:disable fast resend(default), 1:enable fast resend nc: false: normal congestion control(default), true: disable congestion control

Set wndsize set maximum window size: sndwnd=32, rcvwnd=32 by default

snd_wnd Send window

rcv_wnd Receive window

Get waitsnd, how many packet is waiting to be sent

Set rx_minrto

Set fastresend

KCP header size

Enabled stream or not

Maximum Segment Size

Set maximum resend times

Check if KCP connection is dead (resend times excceeded)

Trait Implementations

impl<Output: Default + Write> Default for Kcp<Output>
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl<Output> Send for Kcp<Output> where
    Output: Send

impl<Output> Sync for Kcp<Output> where
    Output: Sync