pub fn state(&self) -> NetworkState {
        if self.receive.last_ping.elapsed().as_secs_f64() > TParam::RECEIVE_PING_TIMEOUT_S {
            if self.send.last_ping.elapsed().as_secs_f64() > TParam::SEND_PING_TIMEOUT_S {
                NetworkState::Connecting
            } else {
                NetworkState::Disconnected
            }
        } else {
            NetworkState::Connected
        }
    }
/// Get the current state of this connector. This is dependent on a couple of settings in ConnectorParam:
/// * If we have received a ping since `ConnectorParam::RECEIVE_PING_TIMEOUT_S` ago, we're connected
/// * If we have send a ping since `ConnectorParam::SEND_PING_TIMEOUT_S` ago, we're connecting
/// * Else we're disconnected
Get the current state of this connector.
Get the current state of this connector .
pub fn state(&self) -> NetworkState {
        if self.receive.last_ping.elapsed().as_secs_f64() > TParam::RECEIVE_PING_TIMEOUT_S {
            if self.send.last_ping.elapsed().as_secs_f64() > TParam::SEND_PING_TIMEOUT_S {
                NetworkState::Connecting
            } else {
                NetworkState::Disconnected
            }
        } else {
            NetworkState::Connected
        }
    }
pub fn state ( & self ) -> NetworkState { if self . receive . last_ping . elapsed ( ) . as_secs_f64 ( ) > TParam :: RECEIVE_PING_TIMEOUT_S { if self . send . last_ping . elapsed ( ) . as_secs_f64 ( ) > TParam :: SEND_PING_TIMEOUT_S { NetworkState :: Connecting } else { NetworkState :: Disconnected } } else { NetworkState :: Connected } }
Get the current state of this connector.
Get the current state of this connector .
&self
&self