Skip to content

Commit

Permalink
Prevent z_sub_thr from reading EOF from stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry73204 committed Jan 12, 2024
1 parent 7c1d786 commit 8a222e9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions examples/examples/z_sub_thr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
use clap::Parser;
use std::io::{stdin, Read};
use std::time::Instant;
use std::time::{Duration, Instant};
use zenoh::config::Config;
use zenoh::prelude::sync::*;
use zenoh_examples::CommonArgs;
Expand Down Expand Up @@ -95,11 +95,15 @@ fn main() {
.res()
.unwrap();

for byte in stdin().bytes() {
match byte {
Ok(b'q') => break,
_ => std::thread::yield_now(),
}
// for byte in stdin().bytes() {
// match byte {
// Ok(b'q') => break,
// _ => std::thread::yield_now(),
// }
// }

loop {
std::thread::park();
}
}

Expand Down

0 comments on commit 8a222e9

Please sign in to comment.