File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,13 @@ pub mod receiver {
133133 ) ?;
134134 let mut events = Events :: with_capacity ( 1 ) ;
135135
136+ let start = Instant :: now ( ) ;
137+
136138 while self . active {
139+ if start. elapsed ( ) >= RECEIVE_TIMEOUT {
140+ return Err ( Box :: new ( simple_error:: simple_error!( "TCP listening for stream {} timed out" , self . stream_idx) ) ) ;
141+ }
142+
137143 poll. poll ( & mut events, Some ( POLL_TIMEOUT ) ) ?;
138144 for event in events. iter ( ) {
139145 match event. token ( ) {
Original file line number Diff line number Diff line change @@ -282,8 +282,7 @@ pub mod receiver {
282282 }
283283 } ,
284284 Err ( e) if e. kind ( ) == std:: io:: ErrorKind :: WouldBlock => { //receive timeout
285- //break;
286- continue ;
285+ break ;
287286 } ,
288287 Err ( e) => {
289288 return Some ( Err ( Box :: new ( e) ) ) ;
You can’t perform that action at this time.
0 commit comments