Browse Source

read from std in

Key-exchange
Julian Graf 2 years ago
parent
commit
a6c03b9857
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/bin/client.rs

+ 13
- 0
src/bin/client.rs View File

@@ -7,4 +7,17 @@ fn main() {
} else {
println!("Couldn't connect to server...");
}

loop {
let mut buffer = String::new();
match std::io::stdin().read_line(&mut buffer){
Ok(_n) => {
println!("{}", buffer);
}
Err(_error) =>{
println!("Fehlerhafte Eingabe!");
break;
}
}
}
} // the stream is closed here

Loading…
Cancel
Save