mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
Change net::Incoming signature to match std. (#89)
std's `Incoming` iterator yields `TcpStream` instances. This patch updates the `Incoming` future to match this signature. This changes the yielded value from `(TcpStream, SocketAddr)` -> `TcpStream`.
This commit is contained in:
committed by
Alex Crichton
parent
f4ec9a6360
commit
ae627db266
@@ -50,7 +50,8 @@ fn main() {
|
||||
|
||||
// The compress logic will happen in the function below, but everything's
|
||||
// still a future! Each client is spawned to concurrently get processed.
|
||||
let server = socket.incoming().for_each(move |(socket, addr)| {
|
||||
let server = socket.incoming().for_each(move |socket| {
|
||||
let addr = socket.peer_addr().unwrap();
|
||||
pool.execute(compress(socket, &pool).then(move |result| {
|
||||
match result {
|
||||
Ok((r, w)) => println!("{}: compressed {} bytes to {}", addr, r, w),
|
||||
|
||||
Reference in New Issue
Block a user