fn flush(&mut self, token: Token) {
        trace!("flush {:?}", token);
        self.times[token.0] = self.clocksource.counter();
        if self.connections[token].flush().is_ok() {
            if let Some(s) = self.connections[token].stream() {
                self.register(s, token);
            }
        } else {
            self.send_stat(token, Stat::ConnectError);
            self.connections[token].connect_failed();
            self.reconnect(token);
        }
    }
/// write remaining buffer to underlying stream for token
/// - reconnect on failure
/// - transition to Reading when write buffer depleated
write remaining buffer to underlying stream for token
reconnect on failure
transition to Reading when write buffer depleated
write remaining buffer to underlying stream for token reconnect on failure transition to Reading when write buffer depleated
fn flush(&mut self, token: Token) {
        trace!("flush {:?}", token);
        self.times[token.0] = self.clocksource.counter();
        if self.connections[token].flush().is_ok() {
            if let Some(s) = self.connections[token].stream() {
                self.register(s, token);
            }
        } else {
            self.send_stat(token, Stat::ConnectError);
            self.connections[token].connect_failed();
            self.reconnect(token);
        }
    }
fn flush ( & mut self , token : Token ) { trace ! ( " " token ) ; self . times [ token . 0 ] = self . clocksource . counter ( ) ; if self . connections [ token ] . flush ( ) . is_ok ( ) { if let Some ( s ) = self . connections [ token ] . stream ( ) { self . register ( s , token ) ; } } else { self . send_stat ( token , Stat :: ConnectError ) ; self . connections [ token ] . connect_failed ( ) ; self . reconnect ( token ) ; } }
write remaining buffer to underlying stream for token
 reconnect on failure
 transition to Reading when write buffer depleated
write remaining buffer to underlying stream for token reconnect on failure transition to Reading when write buffer depleated
&mut self
token
Token
&mut self
token
Token