mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 17:03: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 {
|
||||
fn drop(&mut self) {
|
||||
self.close();
|
||||
self.iface.poll();
|
||||
self.iface.common().remove_socket(self.handle);
|
||||
self.iface.common().release_port(self.port);
|
||||
self.iface.common().remove_bound_socket(self.weak_ref());
|
||||
|
@ -138,8 +138,9 @@ impl IfaceCommon {
|
||||
};
|
||||
if has_events {
|
||||
self.bound_sockets.read().iter().for_each(|bound_socket| {
|
||||
let bound_socket = bound_socket.upgrade().unwrap();
|
||||
bound_socket.update_socket_state();
|
||||
if let Some(bound_socket) = bound_socket.upgrade() {
|
||||
bound_socket.update_socket_state();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user