kcpserver 0.3.1

fast kcp server frame.
docs.rs failed to build kcpserver-0.3.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: kcpserver-0.3.0

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(())
}