mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
Merge pull request #175 from mayhewj/rename-sender
Rename sender in connect example
This commit is contained in:
commit
a3c1796a45
@ -104,7 +104,7 @@ impl Codec for Bytes {
|
|||||||
|
|
||||||
// Our helper method which will read data from stdin and send it along the
|
// Our helper method which will read data from stdin and send it along the
|
||||||
// sender provided.
|
// sender provided.
|
||||||
fn read_stdin(mut rx: mpsc::Sender<Vec<u8>>) {
|
fn read_stdin(mut tx: mpsc::Sender<Vec<u8>>) {
|
||||||
let mut stdin = io::stdin();
|
let mut stdin = io::stdin();
|
||||||
loop {
|
loop {
|
||||||
let mut buf = vec![0; 1024];
|
let mut buf = vec![0; 1024];
|
||||||
@ -114,6 +114,6 @@ fn read_stdin(mut rx: mpsc::Sender<Vec<u8>>) {
|
|||||||
Ok(n) => n,
|
Ok(n) => n,
|
||||||
};
|
};
|
||||||
buf.truncate(n);
|
buf.truncate(n);
|
||||||
rx = rx.send(buf).wait().unwrap();
|
tx = tx.send(buf).wait().unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user