#frame #server #echo #fast #kcp

kcpserver

fast kcp server frame

16 releases

0.3.1 Feb 2, 2021
0.3.0 Feb 2, 2021
0.2.8 Dec 7, 2020
0.2.7 Oct 30, 2020
0.1.4 Sep 18, 2020
Download history 33/week @ 2021-03-22 32/week @ 2021-03-29 32/week @ 2021-04-05 22/week @ 2021-04-12 32/week @ 2021-04-19 3/week @ 2021-04-26 16/week @ 2021-05-03 17/week @ 2021-05-17 16/week @ 2021-06-07 1/week @ 2021-06-14 1/week @ 2021-06-28

74 downloads per month

MIT/Apache

76KB
2K SLoC

kcp_server

性能最牛逼 最好用的RUST KCP 服务器框架

Examples Echo

#![feature(async_closure)]
use kcpserver::KcpListener;
use kcpserver::KcpConfig;
use kcpserver::KcpNoDelayConfig;
use std::error::Error;

#[tokio::main]
async fn main()->Result<(),Box<dyn Error>>{
    let mut config = KcpConfig::default();
    config.nodelay = Some(KcpNoDelayConfig::fastest());
    let kcp = KcpListener::<(), _>::new("0.0.0.0:5555", config,30).await?;
    kcp.set_buff_input(async move |peer, data| {
        peer.send(&data).await?;
        Ok(())
    });
    kcp.start().await?;
    Ok(())
}

Dependencies

~4.5MB
~78K SLoC