mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
Avoiding busy loop in sending packet and optimize device caps
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e0106f1f18
commit
f793259512
@ -12,7 +12,7 @@ impl device::Device for dyn AnyNetworkDevice {
|
||||
type TxToken<'a> = TxToken<'a>;
|
||||
|
||||
fn receive(&mut self, _timestamp: Instant) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> {
|
||||
if self.can_receive() {
|
||||
if self.can_receive() && self.can_send() {
|
||||
let rx_buffer = self.receive().unwrap();
|
||||
Some((RxToken(rx_buffer), TxToken(self)))
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user