mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-23 05:00:52 +03:00
better error messages
This commit is contained in:
@@ -95,19 +95,25 @@ impl App {
|
||||
let keyboard: Vk = self.vkm.create_virtual_keyboard(&self.seat, &self.qh, ());
|
||||
|
||||
// receive keymap from device
|
||||
eprintln!("connecting to {}", client.addr);
|
||||
|
||||
eprint!("\rconnecting to {} ", client.addr);
|
||||
let mut attempts = 0;
|
||||
let data = loop {
|
||||
match request::request_data(client.addr, Request::KeyMap) {
|
||||
Some(data) => break data,
|
||||
None => {
|
||||
eprint!(".");
|
||||
io::stderr().flush().unwrap();
|
||||
thread::sleep(Duration::from_millis(500));
|
||||
}
|
||||
let result = request::request_data(client.addr, Request::KeyMap);
|
||||
eprint!("\rconnecting to {} ", client.addr);
|
||||
for _ in 0..attempts { eprint!("."); }
|
||||
match result {
|
||||
Ok(data) => break data,
|
||||
Err(e) => { eprint!(" - {}", e); }
|
||||
}
|
||||
io::stderr().flush().unwrap();
|
||||
thread::sleep(Duration::from_millis(500));
|
||||
attempts += 1;
|
||||
};
|
||||
|
||||
eprint!("\rconnecting to {} ", client.addr);
|
||||
for _ in 0..attempts { eprint!("."); }
|
||||
eprintln!(" done! ");
|
||||
|
||||
// TODO use shm_open
|
||||
let f = tempfile::tempfile().unwrap();
|
||||
let mut buf = BufWriter::new(&f);
|
||||
|
||||
Reference in New Issue
Block a user