pub struct NetConnectionRealTimeInfo { /* private fields */ }
Expand description

SteamNetConnectionRealTimeStatus_t structure

Implementations§

source§

impl NetConnectionRealTimeInfo

source

pub fn connection_state( &self ) -> Result<NetworkingConnectionState, InvalidConnectionState>

source

pub fn ping(&self) -> i32

source

pub fn connection_quality_local(&self) -> f32

Connection quality measured locally, 0…1. (Percentage of packets delivered)

source

pub fn connection_quality_remote(&self) -> f32

Packet delivery success rate as observed from remote host

source

pub fn out_packets_per_sec(&self) -> f32

Current data rates from recent history

source

pub fn out_bytes_per_sec(&self) -> f32

Current data rates from recent history

source

pub fn in_packets_per_sec(&self) -> f32

Current data rates from recent history

source

pub fn in_bytes_per_sec(&self) -> f32

Current data rates from recent history

source

pub fn send_rate_bytes_per_sec(&self) -> i32

Estimate rate that we believe that we can send data to our peer. Note that this could be significantly higher than m_flOutBytesPerSec, meaning the capacity of the channel is higher than you are sending data. (That’s OK!)

source

pub fn pending_unreliable(&self) -> i32

Number of bytes pending to be sent. This is data that you have recently requested to be sent but has not yet actually been put on the wire. The reliable number ALSO includes data that was previously placed on the wire, but has now been scheduled for re-transmission. Thus, it’s possible to observe m_cbPendingReliable increasing between two checks, even if no calls were made to send reliable data between the checks. Data that is awaiting the Nagle delay will appear in these numbers.

source

pub fn pending_reliable(&self) -> i32

Number of bytes pending to be sent. This is data that you have recently requested to be sent but has not yet actually been put on the wire. The reliable number ALSO includes data that was previously placed on the wire, but has now been scheduled for re-transmission. Thus, it’s possible to observe m_cbPendingReliable increasing between two checks, even if no calls were made to send reliable data between the checks. Data that is awaiting the Nagle delay will appear in these numbers.

source

pub fn sent_unacked_reliable(&self) -> i32

Number of bytes of reliable data that has been placed the wire, but for which we have not yet received an acknowledgment, and thus we may have to re-transmit.

source

pub fn queued_send_bytes(&self) -> i64

If you asked us to send a message right now, how long would that message sit in the queue before we actually started putting packets on the wire? (And assuming Nagle does not cause any packets to be delayed.)

In general, data that is sent by the application is limited by the bandwidth of the channel. If you send data faster than this, it must be queued and put on the wire at a metered rate. Even sending a small amount of data (e.g. a few MTU, say ~3k) will require some of the data to be delayed a bit.

In general, the estimated delay will be approximately equal to

( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond

plus or minus one MTU. It depends on how much time has elapsed since the last packet was put on the wire. For example, the queue might have just been emptied, and the last packet placed on the wire, and we are exactly up against the send rate limit. In that case we might need to wait for one packet’s worth of time to elapse before we can send again. On the other extreme, the queue might have data in it waiting for Nagle. (This will always be less than one packet, because as soon as we have a complete packet we would send it.) In that case, we might be ready to send data now, and this value will be 0.

Trait Implementations§

source§

impl Clone for NetConnectionRealTimeInfo

source§

fn clone(&self) -> NetConnectionRealTimeInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NetConnectionRealTimeInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<SteamNetConnectionRealTimeStatus_t> for NetConnectionRealTimeInfo

source§

fn from(info: SteamNetConnectionRealTimeStatus_t) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.