fn poll(&mut self, handle: &Handle) -> Poll<TcpStream, io::Error> {
        let mut err = None;
        loop {
            if let Some(ref mut current) = self.current {
                match current.poll() {
                    Ok(ok) => return Ok(ok),
                    Err(e) => {
                        trace!("connect error {:?}", e);
                        err = Some(e);
                        if let Some(addr) = self.addrs.next() {
                            debug!("connecting to {:?}", addr);
                            *current = TcpStream::connect(&addr, handle);
                            continue;
                        }
                    }
                }
            } else if let Some(addr) = self.addrs.next() {
                debug!("connecting to {:?}", addr);
                self.current = Some(TcpStream::connect(&addr, handle));
                continue;
            }

            return Err(err.take().expect("missing connect error"));
        }
    }
// not a Future, since passing a &Handle to poll
not a Future, since passing a &Handle to poll
not a Future since passing a &Handle to poll
fn poll(&mut self, handle: &Handle) -> Poll<TcpStream, io::Error> {
        let mut err = None;
        loop {
            if let Some(ref mut current) = self.current {
                match current.poll() {
                    Ok(ok) => return Ok(ok),
                    Err(e) => {
                        trace!("connect error {:?}", e);
                        err = Some(e);
                        if let Some(addr) = self.addrs.next() {
                            debug!("connecting to {:?}", addr);
                            *current = TcpStream::connect(&addr, handle);
                            continue;
                        }
                    }
                }
            } else if let Some(addr) = self.addrs.next() {
                debug!("connecting to {:?}", addr);
                self.current = Some(TcpStream::connect(&addr, handle));
                continue;
            }
            return Err(err.take().expect("missing connect error"));
        }
    }
fn poll ( & mut self , handle : & Handle ) -> Poll < TcpStream , io :: Error > { let mut err = None ; loop { if let Some ( ref mut current ) = self . current { match current . poll ( ) { Ok ( ok ) => return Ok ( ok ) , Err ( e ) => { trace ! ( " " e ) ; err = Some ( e ) ; if let Some ( addr ) = self . addrs . next ( ) { debug ! ( " " addr ) ; * current = TcpStream :: connect ( & addr , handle ) ; continue ; } } } } else if let Some ( addr ) = self . addrs . next ( ) { debug ! ( " " addr ) ; self . current = Some ( TcpStream :: connect ( & addr , handle ) ) ; continue ; } return Err ( err . take ( ) . expect ( " " ) ) ; } }
not a Future, since passing a &Handle to poll
not a Future since passing a &Handle to poll
&mut self
handle
&Handle
&mut self
handle
&Handle