fn kill_connection(&mut self, key: ConnMapKey) {
        let mut had_rx = false;
        METRICS.vsock.conns_killed.inc();

        self.conn_map.entry(key).and_modify(|conn| {
            had_rx = conn.has_pending_rx();
            conn.kill();
        });
        // This connection will now have an RST packet to yield, so we need to add it to the RX
        // queue.  However, there's no point in doing that if it was already in the queue.
        if !had_rx {
            // We can safely ignore any error in adding a connection RX indication. Worst case
            // scenario, the RX queue will get desynchronized, but we'll handle that the next
            // time we need to yield an RX packet.
            self.rxq.push(MuxerRx::ConnRx(key));
        }
    }
/// Schedule a connection for immediate termination.
/// I.e. as soon as we can also let our peer know we're dropping the connection, by sending
/// it an RST packet.
Schedule a connection for immediate termination.
Schedule a connection for immediate termination .
fn kill_connection(&mut self, key: ConnMapKey) {
        let mut had_rx = false;
        METRICS.vsock.conns_killed.inc();
        self.conn_map.entry(key).and_modify(|conn| {
            had_rx = conn.has_pending_rx();
            conn.kill();
        });
        // This connection will now have an RST packet to yield, so we need to add it to the RX
        // queue.  However, there's no point in doing that if it was already in the queue.
        if !had_rx {
            // We can safely ignore any error in adding a connection RX indication. Worst case
            // scenario, the RX queue will get desynchronized, but we'll handle that the next
            // time we need to yield an RX packet.
            self.rxq.push(MuxerRx::ConnRx(key));
        }
    }
fn kill_connection ( & mut self , key : ConnMapKey ) { let mut had_rx = false ; METRICS . vsock . conns_killed . inc ( ) ; self . conn_map . entry ( key ) . and_modify ( | conn | { had_rx = conn . has_pending_rx ( ) ; conn . kill ( ) ; } ) ; // This connection will now have an RST packet to yield, so we need to add it to the RX // queue.  However, there's no point in doing that if it was already in the queue. if ! had_rx { // We can safely ignore any error in adding a connection RX indication. Worst case // scenario, the RX queue will get desynchronized, but we'll handle that the next // time we need to yield an RX packet. self . rxq . push ( MuxerRx :: ConnRx ( key ) ) ; } }
Schedule a connection for immediate termination.
Schedule a connection for immediate termination .
&mut self
key
ConnMapKey
&mut self
key
ConnMapKey