fn terminate(&mut self, reason: ConnectionError) {
        self.error = Some(reason.clone());
        for (_, writer) in self.blocked_writers.drain() {
            writer.wake()
        }
        for (_, reader) in self.blocked_readers.drain() {
            reader.wake()
        }
        self.uni_opening.wake();
        self.bi_opening.wake();
        if let Some(x) = self.incoming_uni_streams_reader.take() {
            x.wake();
        }
        if let Some(x) = self.incoming_bi_streams_reader.take() {
            x.wake();
        }
        if let Some(x) = self.datagram_reader.take() {
            x.wake();
        }
        for (_, x) in self.finishing.drain() {
            let _ = x.send(Some(WriteError::ConnectionClosed(reason.clone())));
        }
        if let Some(x) = self.on_connected.take() {
            let _ = x.send(false);
        }
        for (_, waker) in self.stopped.drain() {
            waker.wake();
        }
    }
/// Used to wake up all blocked futures when the connection becomes closed for any reason
Used to wake up all blocked futures when the connection becomes closed for any reason
Used to wake up all blocked futures when the connection becomes closed for any reason
fn terminate(&mut self, reason: ConnectionError) {
        self.error = Some(reason.clone());
        for (_, writer) in self.blocked_writers.drain() {
            writer.wake()
        }
        for (_, reader) in self.blocked_readers.drain() {
            reader.wake()
        }
        self.uni_opening.wake();
        self.bi_opening.wake();
        if let Some(x) = self.incoming_uni_streams_reader.take() {
            x.wake();
        }
        if let Some(x) = self.incoming_bi_streams_reader.take() {
            x.wake();
        }
        if let Some(x) = self.datagram_reader.take() {
            x.wake();
        }
        for (_, x) in self.finishing.drain() {
            let _ = x.send(Some(WriteError::ConnectionClosed(reason.clone())));
        }
        if let Some(x) = self.on_connected.take() {
            let _ = x.send(false);
        }
        for (_, waker) in self.stopped.drain() {
            waker.wake();
        }
    }
fn terminate ( & mut self , reason : ConnectionError ) { self . error = Some ( reason . clone ( ) ) ; for ( _ , writer ) in self . blocked_writers . drain ( ) { writer . wake ( ) } for ( _ , reader ) in self . blocked_readers . drain ( ) { reader . wake ( ) } self . uni_opening . wake ( ) ; self . bi_opening . wake ( ) ; if let Some ( x ) = self . incoming_uni_streams_reader . take ( ) { x . wake ( ) ; } if let Some ( x ) = self . incoming_bi_streams_reader . take ( ) { x . wake ( ) ; } if let Some ( x ) = self . datagram_reader . take ( ) { x . wake ( ) ; } for ( _ , x ) in self . finishing . drain ( ) { let _ = x . send ( Some ( WriteError :: ConnectionClosed ( reason . clone ( ) ) ) ) ; } if let Some ( x ) = self . on_connected . take ( ) { let _ = x . send ( false ) ; } for ( _ , waker ) in self . stopped . drain ( ) { waker . wake ( ) ; } }
Used to wake up all blocked futures when the connection becomes closed for any reason
Used to wake up all blocked futures when the connection becomes closed for any reason
&mut self
reason
ConnectionError