| Crates.io | tcplane |
| lib.rs | tcplane |
| version | 5.0.0 |
| created_at | 2025-01-01 09:07:43.795427+00 |
| updated_at | 2025-08-15 14:35:18.319092+00 |
| description | tcplane is a lightweight and high-performance Rust TCP server library designed to simplify network service development. It supports TCP communication, data stream management, and connection handling, focusing on providing efficient low-level network connections and data transmission capabilities, making it ideal for building modern network services. |
| homepage | |
| repository | https://github.com/crates-dev/tcplane.git |
| max_upload_size | |
| id | 1500675 |
| size | 46,416 |
tcplane is a lightweight and high-performance Rust TCP server library designed to simplify network service development. It supports TCP communication, data stream management, and connection handling, focusing on providing efficient low-level network connections and data transmission capabilities, making it ideal for building modern network services.
To use this crate, you can run cmd:
cargo add tcplane
use tcplane::*;
async fn test_func(ctx: Context) {
ctx.send("tcplane: 1").await.unwrap();
}
fn error_handle(error: String) {
eprintln!("{}", error);
let _ = std::io::Write::flush(&mut std::io::stderr());
}
#[tokio::main]
async fn main() {
let mut server: Server = Server::new().await;
server.host("0.0.0.0").await;
server.port(60000).await;
server.buffer(100_024_000).await;
server.error_handle(error_handle).await;
server.func(test_func).await;
server
.func(|ctx: Context| async move {
ctx.send("tcplane: 2").await.unwrap();
})
.await;
server.run().await;
}
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.
For any inquiries, please reach out to the author at root@ltpp.vip.