concurrent read write loop working

relies on timeouts. Write to Networks doesn't work yet
This commit is contained in:
Jett Chen 2023-11-28 22:05:31 +08:00
parent 6c1c806401
commit 4038d125db
7 changed files with 121 additions and 51 deletions

View file

@ -50,6 +50,12 @@ impl TunInterface {
buf[..len-4].copy_from_slice(&tmp_buf[4..len]);
len-4
}
#[throws]
#[instrument]
pub fn set_timeout(&self, timeout: Option<std::time::Duration>) {
self.socket.set_read_timeout(timeout)?;
}
}
#[instrument]