use std::time;
use ration::Array;
fn main() {
let mut client_array: Array<char> = Array::alloc("/tmp/CHANNEL_CLIENT", 64).unwrap();
let mut server_array: Array<char> = Array::open("/tmp/CHANNEL_SERVER").unwrap();
let start_time = time::Instant::now();
let mut char_iter = "thisisatest".chars(); loop {
if time::Instant::now().duration_since(start_time) >= time::Duration::from_secs(3) {
println!("CLIENT: Done!");
break;
}
if let Some(ch) = server_array.pop() {
println!("CLIENT: Sending message #{ch}...");
client_array.push(char_iter.next().unwrap());
}
}
}