Enum ESteamNetworkingConnectionState

Source
#[repr(i32)]
pub enum ESteamNetworkingConnectionState { k_ESteamNetworkingConnectionState_None = 0, k_ESteamNetworkingConnectionState_Connecting = 1, k_ESteamNetworkingConnectionState_FindingRoute = 2, k_ESteamNetworkingConnectionState_Connected = 3, k_ESteamNetworkingConnectionState_ClosedByPeer = 4, k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5, k_ESteamNetworkingConnectionState_FinWait = -1, k_ESteamNetworkingConnectionState_Linger = -2, k_ESteamNetworkingConnectionState_Dead = -3, k_ESteamNetworkingConnectionState__Force32Bit = 2_147_483_647, }
Expand description

High level connection status

Variants§

§

k_ESteamNetworkingConnectionState_None = 0

Dummy value used to indicate an error condition in the API. Specified connection doesn’t exist or has already been closed.

§

k_ESteamNetworkingConnectionState_Connecting = 1

We are trying to establish whether peers can talk to each other, whether they WANT to talk to each other, perform basic auth, and exchange crypt keys.

  • For connections on the “client” side (initiated locally): We’re in the process of trying to establish a connection. Depending on the connection type, we might not know who they are. Note that it is not possible to tell if we are waiting on the network to complete handshake packets, or for the application layer to accept the connection.

  • For connections on the “server” side (accepted through listen socket): We have completed some basic handshake and the client has presented some proof of identity. The connection is ready to be accepted using AcceptConnection().

In either case, any unreliable packets sent now are almost certain to be dropped. Attempts to receive packets are guaranteed to fail. You may send messages if the send mode allows for them to be queued. but if you close the connection before the connection is actually established, any queued messages will be discarded immediately. (We will not attempt to flush the queue and confirm delivery to the remote host, which ordinarily happens when a connection is closed.)

§

k_ESteamNetworkingConnectionState_FindingRoute = 2

Some connection types use a back channel or trusted 3rd party for earliest communication. If the server accepts the connection, then these connections switch into the rendezvous state. During this state, we still have not yet established an end-to-end route (through the relay network), and so if you send any messages unreliable, they are going to be discarded.

§

k_ESteamNetworkingConnectionState_Connected = 3

We’ve received communications from our peer (and we know who they are) and are all good. If you close the connection now, we will make our best effort to flush out any reliable sent data that has not been acknowledged by the peer. (But note that this happens from within the application process, so unlike a TCP connection, you are not totally handing it off to the operating system to deal with it.)

§

k_ESteamNetworkingConnectionState_ClosedByPeer = 4

Connection has been closed by our peer, but not closed locally. The connection still exists from an API perspective. You must close the handle to free up resources. If there are any messages in the inbound queue, you may retrieve them. Otherwise, nothing may be done with the connection except to close it.

This stats is similar to CLOSE_WAIT in the TCP state machine.

§

k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5

A disruption in the connection has been detected locally. (E.g. timeout, local internet connection disrupted, etc.)

The connection still exists from an API perspective. You must close the handle to free up resources.

Attempts to send further messages will fail. Any remaining received messages in the queue are available.

§

k_ESteamNetworkingConnectionState_FinWait = -1

We’ve disconnected on our side, and from an API perspective the connection is closed. No more data may be sent or received. All reliable data has been flushed, or else we’ve given up and discarded it. We do not yet know for sure that the peer knows the connection has been closed, however, so we’re just hanging around so that if we do get a packet from them, we can send them the appropriate packets so that they can know why the connection was closed (and not have to rely on a timeout, which makes it appear as if something is wrong).

§

k_ESteamNetworkingConnectionState_Linger = -2

We’ve disconnected on our side, and from an API perspective the connection is closed. No more data may be sent or received. From a network perspective, however, on the wire, we have not yet given any indication to the peer that the connection is closed. We are in the process of flushing out the last bit of reliable data. Once that is done, we will inform the peer that the connection has been closed, and transition to the FinWait state.

Note that no indication is given to the remote host that we have closed the connection, until the data has been flushed. If the remote host attempts to send us data, we will do whatever is necessary to keep the connection alive until it can be closed properly. But in fact the data will be discarded, since there is no way for the application to read it back. Typically this is not a problem, as application protocols that utilize the lingering functionality are designed for the remote host to wait for the response before sending any more data.

§

k_ESteamNetworkingConnectionState_Dead = -3

Connection is completely inactive and ready to be destroyed

§

k_ESteamNetworkingConnectionState__Force32Bit = 2_147_483_647

Connection is completely inactive and ready to be destroyed

Trait Implementations§

Source§

impl Clone for ESteamNetworkingConnectionState

Source§

fn clone(&self) -> ESteamNetworkingConnectionState

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 ESteamNetworkingConnectionState

Source§

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

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

impl Hash for ESteamNetworkingConnectionState

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ESteamNetworkingConnectionState

Source§

fn cmp(&self, other: &ESteamNetworkingConnectionState) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ESteamNetworkingConnectionState

Source§

fn eq(&self, other: &ESteamNetworkingConnectionState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ESteamNetworkingConnectionState

Source§

fn partial_cmp( &self, other: &ESteamNetworkingConnectionState, ) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for ESteamNetworkingConnectionState

Source§

impl Eq for ESteamNetworkingConnectionState

Source§

impl StructuralPartialEq for ESteamNetworkingConnectionState

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.