File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -641,15 +641,19 @@ impl ActiveRelayActor {
641
641
state : & mut ConnectedRelayState ,
642
642
client_stream : & mut iroh_relay:: client:: ClientStream ,
643
643
) -> Result < ( ) > {
644
- // TODO
645
- // let mut timeout = pin!(tokio::time::sleep())
644
+ const SEND_TIMEOUT : Duration = Duration :: from_secs ( 10 ) ; // TODO: what should this be?
645
+
646
+ let mut timeout = pin ! ( tokio:: time:: sleep( SEND_TIMEOUT ) ) ;
646
647
let mut sending_fut = pin ! ( sending_fut) ;
647
648
loop {
648
649
tokio:: select! {
649
650
biased;
650
651
_ = self . stop_token. cancelled( ) => {
651
652
break Ok ( ( ) ) ;
652
653
}
654
+ _ = & mut timeout => {
655
+ break Err ( anyhow!( "Send timeout" ) ) ;
656
+ }
653
657
msg = self . prio_inbox. recv( ) => {
654
658
let Some ( msg) = msg else {
655
659
warn!( "Priority inbox closed, shutdown." ) ;
You can’t perform that action at this time.
0 commit comments