pub fn stop_network() {
    network_state.store(NetworkState::Stopping);
    if let NetworkField::Network(network_control) = &(network.borrow()).network_control {
        network_control.stop()
    }

    let mut s = network.borrow_mut();
    s.network_control = NetworkField::Uninitialized;
    s.network_sender = NetworkField::Uninitialized;
    network_state.store(NetworkState::Stopped);
    // give machines a chance to react to network shutdown
    thread::sleep(Duration::from_millis(100));
}
/// Stop the network. Stopping will close all network connections and
/// listeners and no further network activity is allowed.
Stop the network. Stopping will close all network connections and
listeners and no further network activity is allowed.
Stop the network . Stopping will close all network connections and listeners and no further network activity is allowed .
pub fn stop_network() {
    network_state.store(NetworkState::Stopping);
    if let NetworkField::Network(network_control) = &(network.borrow()).network_control {
        network_control.stop()
    }
    let mut s = network.borrow_mut();
    s.network_control = NetworkField::Uninitialized;
    s.network_sender = NetworkField::Uninitialized;
    network_state.store(NetworkState::Stopped);
    // give machines a chance to react to network shutdown
    thread::sleep(Duration::from_millis(100));
}
pub fn stop_network ( ) { network_state . store ( NetworkState :: Stopping ) ; if let NetworkField :: Network ( network_control ) = & ( network . borrow ( ) ) . network_control { network_control . stop ( ) } let mut s = network . borrow_mut ( ) ; s . network_control = NetworkField :: Uninitialized ; s . network_sender = NetworkField :: Uninitialized ; network_state . store ( NetworkState :: Stopped ) ; // give machines a chance to react to network shutdown thread :: sleep ( Duration :: from_millis ( 100 ) ) ; }
Stop the network.
Stop the network .