pub fn close(&mut self, now: Instant, error_code: VarInt, reason: Bytes) {
        let was_closed = self.state.is_closed();
        if !was_closed {
            self.close_common();
            self.set_close_timer(now);
            self.close = true;
            self.state = State::Closed(state::Closed {
                reason: Close::Application(frame::ApplicationClose { error_code, reason }),
            });
        }
    }
/// Close a connection immediately
///
/// This does not ensure delivery of outstanding data. It is the application's responsibility to
/// call this only when all important communications have been completed, e.g. by calling
/// [`Connection::finish`] on outstanding streams and waiting for the corresponding
/// [`StreamEvent::Finished`] event.
///
/// If [`Connection::send_streams`] returns 0, all outstanding stream data has been
/// delivered. There may still be data from the peer that has not been received.
///
/// [`StreamEvent::Finished`]: crate::StreamEvent::Finished
Close a connection immediately
This does not ensure delivery of outstanding data. It is the application's responsibility to
call this only when all important communications have been completed, e.g. by calling
[`Connection::finish`] on outstanding streams and waiting for the corresponding
[`StreamEvent::Finished`] event.

If [`Connection::send_streams`] returns 0, all outstanding stream data has been
delivered. There may still be data from the peer that has not been received.


Close a connection immediately This does not ensure delivery of outstanding data . It is the application ' s responsibility to call this only when all important communications have been completed e . g . by calling [ ` Connection :: finish ` ] on outstanding streams and waiting for the corresponding [ ` StreamEvent :: Finished ` ] event . If [ ` Connection :: send_streams ` ] returns 0 all outstanding stream data has been delivered . There may still be data from the peer that has not been received .
pub fn close(&mut self, now: Instant, error_code: VarInt, reason: Bytes) {
        let was_closed = self.state.is_closed();
        if !was_closed {
            self.close_common();
            self.set_close_timer(now);
            self.close = true;
            self.state = State::Closed(state::Closed {
                reason: Close::Application(frame::ApplicationClose { error_code, reason }),
            });
        }
    }
pub fn close ( & mut self , now : Instant , error_code : VarInt , reason : Bytes ) { let was_closed = self . state . is_closed ( ) ; if ! was_closed { self . close_common ( ) ; self . set_close_timer ( now ) ; self . close = true ; self . state = State :: Closed ( state :: Closed { reason : Close :: Application ( frame :: ApplicationClose { error_code , reason } ) , } ) ; } }
Close a connection immediately
This does not ensure delivery of outstanding data.
Close a connection immediately This does not ensure delivery of outstanding data .
&mut self
now
Instant
error_code
VarInt
reason
Bytes