mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 19:33:23 +00:00
Add timeout parameter for poller.wait
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
bd6a4d34ff
commit
ec857e5205
@ -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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user