Add timeout parameter for poller.wait

This commit is contained in:
Jianfeng Jiang
2023-09-21 10:36:49 +08:00
committed by Tate, Hongliang Tian
parent bd6a4d34ff
commit ec857e5205
11 changed files with 37 additions and 29 deletions

View File

@ -258,7 +258,8 @@ impl Socket for DatagramSocket {
if self.nonblocking() {
return_errno_with_message!(Errno::EAGAIN, "try to receive again");
}
poller.wait();
// FIXME: deal with recvfrom timeout
poller.wait(None)?;
}
}
}

View File

@ -57,7 +57,8 @@ impl ConnectedStream {
if self.is_nonblocking() {
return_errno_with_message!(Errno::EAGAIN, "try to recv again");
}
poller.wait();
// FIXME: deal with receive timeout
poller.wait(None)?;
}
}
}

View File

@ -151,7 +151,8 @@ impl InitStream {
} else if self.is_nonblocking() {
return_errno_with_message!(Errno::EAGAIN, "try connect again");
} else {
poller.wait();
// FIXME: deal with connecting timeout
poller.wait(None)?;
}
}
}

View File

@ -45,7 +45,8 @@ impl ListenStream {
if self.is_nonblocking() {
return_errno_with_message!(Errno::EAGAIN, "try accept again");
}
poller.wait();
// FIXME: deal with accept timeout
poller.wait(None)?;
}
continue;
};

View File

@ -131,8 +131,9 @@ impl BacklogTable {
return_errno_with_message!(Errno::ECONNABORTED, "connection is aborted");
}
// FIXME: deal with accept timeout
if events.is_empty() {
poller.wait();
poller.wait(None)?;
}
}
}