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

MIT license

84KB
1.5K SLoC

Stable Test codecov Rust Docs Crate version Download Version License: MIT

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

~12–25MB
~329K SLoC