pub enum NetworkingConnectionState {
    None,
    Connecting,
    FindingRoute,
    Connected,
    ClosedByPeer,
    ProblemDetectedLocally,
}
Expand description

High level connection status

Variants§

§

None

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

§

Connecting

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.)

§

FindingRoute

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.

§

Connected

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.)

§

ClosedByPeer

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.

§

ProblemDetectedLocally

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.

Trait Implementations§

source§

impl Clone for NetworkingConnectionState

source§

fn clone(&self) -> NetworkingConnectionState

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 NetworkingConnectionState

source§

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

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

impl From<NetworkingConnectionState> for ESteamNetworkingConnectionState

source§

fn from(state: NetworkingConnectionState) -> Self

Converts to this type from the input type.
source§

impl PartialEq for NetworkingConnectionState

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<ESteamNetworkingConnectionState> for NetworkingConnectionState

§

type Error = InvalidConnectionState

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

fn try_from(state: ESteamNetworkingConnectionState) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for NetworkingConnectionState

source§

impl Eq for NetworkingConnectionState

source§

impl StructuralPartialEq for NetworkingConnectionState

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.