mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-20 02:04:07 +00:00
Update current timestamp on each driver loop iteration
Ensures a reasonable upper bound for error.
This commit is contained in:
committed by
Dirkjan Ochtman
parent
1f9a8fc337
commit
4e567f03ee
@@ -90,8 +90,8 @@ impl Future for ConnectionDriver {
|
||||
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
||||
let conn = &mut *self.0.lock().unwrap();
|
||||
|
||||
let now = Instant::now();
|
||||
loop {
|
||||
let now = Instant::now();
|
||||
let mut keep_going = false;
|
||||
conn.process_conn_events().unwrap();
|
||||
conn.drive_transmit(now);
|
||||
|
||||
@@ -129,8 +129,8 @@ impl Future for EndpointDriver {
|
||||
if endpoint.driver.is_none() {
|
||||
endpoint.driver = Some(task::current());
|
||||
}
|
||||
let now = Instant::now();
|
||||
loop {
|
||||
let now = Instant::now();
|
||||
let mut keep_going = false;
|
||||
keep_going |= endpoint.drive_recv(now)?;
|
||||
endpoint.drive_incoming();
|
||||
|
||||
Reference in New Issue
Block a user