mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 01:13:23 +00:00
Poll iface when dropping socket
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
dbf5a423b1
commit
4fef4d9b79
@ -174,6 +174,7 @@ impl AnyBoundSocket {
|
|||||||
impl Drop for AnyBoundSocket {
|
impl Drop for AnyBoundSocket {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.close();
|
self.close();
|
||||||
|
self.iface.poll();
|
||||||
self.iface.common().remove_socket(self.handle);
|
self.iface.common().remove_socket(self.handle);
|
||||||
self.iface.common().release_port(self.port);
|
self.iface.common().release_port(self.port);
|
||||||
self.iface.common().remove_bound_socket(self.weak_ref());
|
self.iface.common().remove_bound_socket(self.weak_ref());
|
||||||
|
@ -138,8 +138,9 @@ impl IfaceCommon {
|
|||||||
};
|
};
|
||||||
if has_events {
|
if has_events {
|
||||||
self.bound_sockets.read().iter().for_each(|bound_socket| {
|
self.bound_sockets.read().iter().for_each(|bound_socket| {
|
||||||
let bound_socket = bound_socket.upgrade().unwrap();
|
if let Some(bound_socket) = bound_socket.upgrade() {
|
||||||
bound_socket.update_socket_state();
|
bound_socket.update_socket_state();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user