3 releases
0.5.0-rc | Mar 20, 2020 |
---|---|
0.5.0-beta | Mar 4, 2020 |
0.5.0-alpha | Mar 3, 2020 |
#13 in #tcp-listener
Used in 3 crates
84KB
1.5K
SLoC
Roa-tcp
This crate provides an acceptor implementing roa_core::Accept
and an app extension.
TcpIncoming
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(())
# }
Listener
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(())
# }
Dependencies
~13–23MB
~327K SLoC