@@ -13,7 +13,7 @@ use smoltcp::wire::{IpEndpoint, Ipv4Address, Ipv6Address};
1313
1414use crate :: errno:: Errno ;
1515use crate :: executor:: block_on;
16- use crate :: executor:: network:: { Handle , NIC } ;
16+ use crate :: executor:: network:: { Handle , NETWORK_WAKER , NIC } ;
1717use crate :: fd:: { self , Endpoint , ListenEndpoint , ObjectInterface , PollEvent , SocketOption } ;
1818use crate :: syscalls:: socket:: Af ;
1919use crate :: { DEFAULT_KEEP_ALIVE_INTERVAL , io} ;
@@ -65,14 +65,20 @@ impl Socket {
6565 fn with < R > ( & self , f : impl FnOnce ( & mut tcp:: Socket < ' _ > ) -> R ) -> R {
6666 let mut guard = NIC . lock ( ) ;
6767 let nic = guard. as_nic_mut ( ) . unwrap ( ) ;
68- f ( nic. get_mut_socket :: < tcp:: Socket < ' _ > > ( * self . handle . first ( ) . unwrap ( ) ) )
68+ let r = f ( nic. get_mut_socket :: < tcp:: Socket < ' _ > > ( * self . handle . first ( ) . unwrap ( ) ) ) ;
69+ // FIXME: Ideally this would be our send/recv waker, but we can only have one
70+ NETWORK_WAKER . lock ( ) . wake ( ) ;
71+ r
6972 }
7073
7174 fn with_context < R > ( & self , f : impl FnOnce ( & mut tcp:: Socket < ' _ > , & mut iface:: Context ) -> R ) -> R {
7275 let mut guard = NIC . lock ( ) ;
7376 let nic = guard. as_nic_mut ( ) . unwrap ( ) ;
7477 let ( s, cx) = nic. get_socket_and_context :: < tcp:: Socket < ' _ > > ( * self . handle . first ( ) . unwrap ( ) ) ;
75- f ( s, cx)
78+ let r = f ( s, cx) ;
79+ // FIXME: Ideally this would be our send/recv waker, but we can only have one
80+ NETWORK_WAKER . lock ( ) . wake ( ) ;
81+ r
7682 }
7783
7884 async fn close ( & self ) -> io:: Result < ( ) > {
0 commit comments