| Crates.io | roa-tcp |
| lib.rs | roa-tcp |
| version | 0.5.0-rc |
| created_at | 2020-03-03 14:43:54.312736+00 |
| updated_at | 2020-03-20 13:45:35.130143+00 |
| description | tcp based acceptor for roa |
| homepage | https://github.com/Hexilee/roa/wiki |
| repository | https://github.com/Hexilee/roa |
| max_upload_size | |
| id | 214932 |
| size | 14,424 |
This crate provides an acceptor implementing roa_core::Accept and an app extension.
use roa_core::App;
use roa_tcp::TcpIncoming;
use std::io;
# fn main() -> io::Result<()> {
let app = App::new(());
let incoming = TcpIncoming::bind("127.0.0.1:0")?;
let server = app.accept(incoming);
// server.await
Ok(())
# }
use roa_core::App;
use roa_tcp::Listener;
use std::io;
# fn main() -> io::Result<()> {
let app = App::new(());
let (addr, server) = app.listen_on("127.0.0.1:0")?;
// server.await
Ok(())
# }