Created
April 20, 2018 16:01
-
-
Save aep/8f1f6ee62d9d87a0ff2e32c397e78495 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tcp = tcp | |
.map_err(|e| error!("Error: {}", e)) | |
.map(move |stream| { | |
info!("connected"); | |
let mut b = Vec::new(); | |
tokio_io::io::read_to_end(stream, b) | |
.map_err(|e| error!("Error: {}", e)) | |
.and_then(|(socket, b)| { | |
println!(">{:?}<", b); | |
ok(()) | |
}) | |
}); | |
core.run(tcp); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment