| 7 | |
| 8 | impl ClientHandshake { |
| 9 | pub fn blocking_finish(self) -> Result<(ClientConnection, InputStream, OutputStream), IoError> { |
| 10 | let future = ClientHandshake::finish(self); |
| 11 | let timeout = monotonic_clock::subscribe_duration(TIMEOUT_NS * 200); |
| 12 | let pollable = future.subscribe(); |
| 13 | |
| 14 | loop { |
| 15 | match future.get() { |
| 16 | None => pollable.block_until(&timeout).expect("timed out"), |
| 17 | Some(Ok(r)) => return r, |
| 18 | Some(Err(e)) => { |
| 19 | eprintln!("{e:?}"); |
| 20 | unimplemented!() |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | impl ClientConnection { |