Expand description
§kcp-io
A Rust wrapper for the KCP protocol, providing FFI bindings, a safe API, and async tokio integration.
§Features
kcp-sys— Raw FFI bindings to the KCP C librarykcp-core— Safe Rust wrapper (implieskcp-sys)kcp-tokio— Async tokio integration (implieskcp-core, enabled by default)
§Quick Start
use kcp_io::tokio_rt::{KcpStream, KcpSessionConfig};
let mut stream = KcpStream::connect("127.0.0.1:8080", KcpSessionConfig::fast()).await?;
stream.send_kcp(b"hello").await?;
let data = stream.recv_kcp().await?;
println!("Received: {:?}", data);Re-exports§
pub use tokio_rt::KcpListener;pub use tokio_rt::KcpSessionConfig;pub use tokio_rt::KcpStream;pub use tokio_rt::KcpTokioError;pub use tokio_rt::KcpTokioResult;pub use core::Kcp;pub use core::KcpConfig;pub use core::KcpError;pub use core::KcpResult;