#[repr(i32)]
#[non_exhaustive]
pub enum ESteamNetworkingConfigValue {
Show 58 variants k_ESteamNetworkingConfig_Invalid, k_ESteamNetworkingConfig_TimeoutInitial, k_ESteamNetworkingConfig_TimeoutConnected, k_ESteamNetworkingConfig_SendBufferSize, k_ESteamNetworkingConfig_ConnectionUserData, k_ESteamNetworkingConfig_SendRateMin, k_ESteamNetworkingConfig_SendRateMax, k_ESteamNetworkingConfig_NagleTime, k_ESteamNetworkingConfig_IP_AllowWithoutAuth, k_ESteamNetworkingConfig_MTU_PacketSize, k_ESteamNetworkingConfig_MTU_DataSize, k_ESteamNetworkingConfig_Unencrypted, k_ESteamNetworkingConfig_SymmetricConnect, k_ESteamNetworkingConfig_LocalVirtualPort, k_ESteamNetworkingConfig_DualWifi_Enable, k_ESteamNetworkingConfig_EnableDiagnosticsUI, k_ESteamNetworkingConfig_FakePacketLoss_Send, k_ESteamNetworkingConfig_FakePacketLoss_Recv, k_ESteamNetworkingConfig_FakePacketLag_Send, k_ESteamNetworkingConfig_FakePacketLag_Recv, k_ESteamNetworkingConfig_FakePacketReorder_Send, k_ESteamNetworkingConfig_FakePacketReorder_Recv, k_ESteamNetworkingConfig_FakePacketReorder_Time, k_ESteamNetworkingConfig_FakePacketDup_Send, k_ESteamNetworkingConfig_FakePacketDup_Recv, k_ESteamNetworkingConfig_FakePacketDup_TimeMax, k_ESteamNetworkingConfig_PacketTraceMaxBytes, k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate, k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst, k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate, k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst, k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, k_ESteamNetworkingConfig_Callback_AuthStatusChanged, k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged, k_ESteamNetworkingConfig_Callback_MessagesSessionRequest, k_ESteamNetworkingConfig_Callback_MessagesSessionFailed, k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling, k_ESteamNetworkingConfig_Callback_FakeIPResult, k_ESteamNetworkingConfig_P2P_STUN_ServerList, k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable, k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty, k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty, k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial, k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail, k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate, k_ESteamNetworkingConfig_SDRClient_SingleSocket, k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster, k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress, k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr, k_ESteamNetworkingConfig_SDRClient_FakeClusterPing, k_ESteamNetworkingConfig_LogLevel_AckRTT, k_ESteamNetworkingConfig_LogLevel_PacketDecode, k_ESteamNetworkingConfig_LogLevel_Message, k_ESteamNetworkingConfig_LogLevel_PacketGaps, k_ESteamNetworkingConfig_LogLevel_P2PRendezvous, k_ESteamNetworkingConfig_LogLevel_SDRRelayPings, k_ESteamNetworkingConfig_DELETED_EnumerateDevVars, k_ESteamNetworkingConfigValue__Force32Bit,
}
Expand description

Configuration options

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

k_ESteamNetworkingConfig_Invalid

k_ESteamNetworkingConfig_TimeoutInitial

[connection int32] Timeout value (in ms) to use when first connecting

k_ESteamNetworkingConfig_TimeoutConnected

[connection int32] Timeout value (in ms) to use after connection is established

k_ESteamNetworkingConfig_SendBufferSize

[connection int32] Upper limit of buffered pending bytes to be sent, if this is reached SendMessage will return k_EResultLimitExceeded Default is 512k (524288 bytes)

k_ESteamNetworkingConfig_ConnectionUserData

[connection int64] Get/set userdata as a configuration option. The default value is -1. You may want to set the user data as a config value, instead of using ISteamNetworkingSockets::SetConnectionUserData in two specific instances:

  • You wish to set the userdata atomically when creating an outbound connection, so that the userdata is filled in properly for any callbacks that happen. However, note that this trick only works for connections initiated locally! For incoming connections, multiple state transitions may happen and callbacks be queued, before you are able to service the first callback! Be careful!

  • You can set the default userdata for all newly created connections by setting this value at a higher level (e.g. on the listen socket or at the global level.) Then this default value will be inherited when the connection is created. This is useful in case -1 is a valid userdata value, and you wish to use something else as the default value so you can tell if it has been set or not.

    HOWEVER: once a connection is created, the effective value is then bound to the connection. Unlike other connection options, if you change it again at a higher level, the new value will not be inherited by connections.

Using the userdata field in callback structs is not advised because of tricky race conditions. Instead, you might try one of these methods:

  • Use a separate map with the HSteamNetConnection as the key.
  • Fetch the userdata from the connection in your callback using ISteamNetworkingSockets::GetConnectionUserData, to

k_ESteamNetworkingConfig_SendRateMin

[connection int32] Minimum/maximum send rate clamp, 0 is no limit. This value will control the min/max allowed sending rate that bandwidth estimation is allowed to reach. Default is 0 (no-limit)

k_ESteamNetworkingConfig_SendRateMax

[connection int32] Minimum/maximum send rate clamp, 0 is no limit. This value will control the min/max allowed sending rate that bandwidth estimation is allowed to reach. Default is 0 (no-limit)

k_ESteamNetworkingConfig_NagleTime

[connection int32] Nagle time, in microseconds. When SendMessage is called, if the outgoing message is less than the size of the MTU, it will be queued for a delay equal to the Nagle timer value. This is to ensure that if the application sends several small messages rapidly, they are coalesced into a single packet. See historical RFC 896. Value is in microseconds. Default is 5000us (5ms).

k_ESteamNetworkingConfig_IP_AllowWithoutAuth

[connection int32] Don’t automatically fail IP connections that don’t have strong auth. On clients, this means we will attempt the connection even if we don’t know our identity or can’t get a cert. On the server, it means that we won’t automatically reject a connection due to a failure to authenticate. (You can examine the incoming connection and decide whether to accept it.)

This is a dev configuration value, and you should not let users modify it in production.

k_ESteamNetworkingConfig_MTU_PacketSize

[connection int32] Do not send UDP packets with a payload of larger than N bytes. If you set this, k_ESteamNetworkingConfig_MTU_DataSize is automatically adjusted

k_ESteamNetworkingConfig_MTU_DataSize

[connection int32] (read only) Maximum message size you can send that will not fragment, based on k_ESteamNetworkingConfig_MTU_PacketSize

k_ESteamNetworkingConfig_Unencrypted

[connection int32] Allow unencrypted (and unauthenticated) communication. 0: Not allowed (the default) 1: Allowed, but prefer encrypted 2: Allowed, and preferred 3: Required. (Fail the connection if the peer requires encryption.)

This is a dev configuration value, since its purpose is to disable encryption. You should not let users modify it in production. (But note that it requires the peer to also modify their value in order for encryption to be disabled.)

k_ESteamNetworkingConfig_SymmetricConnect

[connection int32] Set this to 1 on outbound connections and listen sockets, to enable “symmetric connect mode”, which is useful in the following common peer-to-peer use case:

  • The two peers are “equal” to each other. (Neither is clearly the “client” or “server”.)
  • Either peer may initiate the connection, and indeed they may do this at the same time
  • The peers only desire a single connection to each other, and if both peers initiate connections simultaneously, a protocol is needed for them to resolve the conflict, so that we end up with a single connection.

This use case is both common, and involves subtle race conditions and tricky pitfalls, which is why the API has support for dealing with it.

If an incoming connection arrives on a listen socket or via custom signaling, and the application has not attempted to make a matching outbound connection in symmetric mode, then the incoming connection can be accepted as usual. A “matching” connection means that the relevant endpoint information matches. (At the time this comment is being written, this is only supported for P2P connections, which means that the peer identities must match, and the virtual port must match. At a later time, symmetric mode may be supported for other connection types.)

If connections are initiated by both peers simultaneously, race conditions can arise, but fortunately, most of them are handled internally and do not require any special awareness from the application. However, there is one important case that application code must be aware of: If application code attempts an outbound connection using a ConnectXxx function in symmetric mode, and a matching incoming connection is already waiting on a listen socket, then instead of forming a new connection, the ConnectXxx call will accept the existing incoming connection, and return a connection handle to this accepted connection. IMPORTANT: in this case, a SteamNetConnectionStatusChangedCallback_t has probably already been posted to the queue for the incoming connection! (Once callbacks are posted to the queue, they are not modified.) It doesn’t matter if the callback has not been consumed by the app. Thus, application code that makes use of symmetric connections must be aware that, when processing a SteamNetConnectionStatusChangedCallback_t for an incoming connection, the m_hConn may refer to a new connection that the app has has not seen before (the usual case), but it may also refer to a connection that has already been accepted implicitly through a call to Connect()! In this case, AcceptConnection() will return k_EResultDuplicateRequest.

Only one symmetric connection to a given peer (on a given virtual port) may exist at any given time. If client code attempts to create a connection, and a (live) connection already exists on the local host, then either the existing connection will be accepted as described above, or the attempt to create a new connection will fail. Furthermore, linger mode functionality is not supported on symmetric connections.

A more complicated race condition can arise if both peers initiate a connection at roughly the same time. In this situation, each peer will receive an incoming connection from the other peer, when the application code has already initiated an outgoing connection to that peer. The peers must resolve this conflict and decide who is going to act as the “server” and who will act as the “client”. Typically the application does not need to be aware of this case as it is handled internally. On both sides, the will observe their outbound connection being “accepted”, although one of them one have been converted internally to act as the “server”.

In general, symmetric mode should be all-or-nothing: do not mix symmetric connections with a non-symmetric connection that it might possible “match” with. If you use symmetric mode on any connections, then both peers should use it on all connections, and the corresponding listen socket, if any. The behaviour when symmetric and ordinary connections are mixed is not defined by this API, and you should not rely on it. (This advice only applies when connections might possibly “match”. For example, it’s OK to use all symmetric mode connections on one virtual port, and all ordinary, non-symmetric connections on a different virtual port, as there is no potential for ambiguity.)

When using the feature, you should set it in the following situations on applicable objects:

  • When creating an outbound connection using ConnectXxx function
  • When creating a listen socket. (Note that this will automatically cause any accepted connections to inherit the flag.)
  • When using custom signaling, before accepting an incoming connection.

Setting the flag on listen socket and accepted connections will enable the API to automatically deal with duplicate incoming connections, even if the local host has not made any outbound requests. (In general, such duplicate requests from a peer are ignored internally and will not be visible to the application code. The previous connection must be closed or resolved first.)

k_ESteamNetworkingConfig_LocalVirtualPort

[connection int32] For connection types that use “virtual ports”, this can be used to assign a local virtual port. For incoming connections, this will always be the virtual port of the listen socket (or the port requested by the remote host if custom signaling is used and the connection is accepted), and cannot be changed. For connections initiated locally, the local virtual port will default to the same as the requested remote virtual port, if you do not specify a different option when creating the connection. The local port is only relevant for symmetric connections, when determining if two connections “match.” In this case, if you need the local and remote port to differ, you can set this value.

You can also read back this value on listen sockets.

This value should not be read or written in any other context.

k_ESteamNetworkingConfig_DualWifi_Enable

[connection int32] Enable Dual wifi band support for this connection 0 = no, 1 = yes, 2 = simulate it for debugging, even if dual wifi not available

k_ESteamNetworkingConfig_EnableDiagnosticsUI

[connection int32] True to enable diagnostics reporting through generic platform UI. (Only available on Steam.)

k_ESteamNetworkingConfig_FakePacketLoss_Send

[global float, 0–100] Randomly discard N pct of packets instead of sending/recv This is a global option only, since it is applied at a low level where we don’t have much context

k_ESteamNetworkingConfig_FakePacketLoss_Recv

[global float, 0–100] Randomly discard N pct of packets instead of sending/recv This is a global option only, since it is applied at a low level where we don’t have much context

k_ESteamNetworkingConfig_FakePacketLag_Send

[global int32]. Delay all outbound/inbound packets by N ms

k_ESteamNetworkingConfig_FakePacketLag_Recv

[global int32]. Delay all outbound/inbound packets by N ms

k_ESteamNetworkingConfig_FakePacketReorder_Send

[global float] 0-100 Percentage of packets we will add additional delay to (causing them to be reordered)

k_ESteamNetworkingConfig_FakePacketReorder_Recv

[global float] 0-100 Percentage of packets we will add additional delay to (causing them to be reordered)

k_ESteamNetworkingConfig_FakePacketReorder_Time

[global int32] Extra delay, in ms, to apply to reordered packets.

k_ESteamNetworkingConfig_FakePacketDup_Send

[global float 0–100] Globally duplicate some percentage of packets we send

k_ESteamNetworkingConfig_FakePacketDup_Recv

[global float 0–100] Globally duplicate some percentage of packets we send

k_ESteamNetworkingConfig_FakePacketDup_TimeMax

[global int32] Amount of delay, in ms, to delay duplicated packets. (We chose a random delay between 0 and this value)

k_ESteamNetworkingConfig_PacketTraceMaxBytes

[global int32] Trace every UDP packet, similar to Wireshark or tcpdump. Value is max number of bytes to dump. -1 disables tracing.

k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate

k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst

k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate

k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst

k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged

[connection FnSteamNetConnectionStatusChanged] Callback that will be invoked when the state of a connection changes.

IMPORTANT: callbacks are dispatched to the handler that is in effect at the time the event occurs, which might be in another thread. For example, immediately after creating a listen socket, you may receive an incoming connection. And then immediately after this, the remote host may close the connection. All of this could happen before the function to create the listen socket has returned. For this reason, callbacks usually must be in effect at the time of object creation. This means you should set them when you are creating the listen socket or connection, or have them in effect so they will be inherited at the time of object creation.

For example:

exterm void MyStatusChangedFunc( SteamNetConnectionStatusChangedCallback_t *info ); SteamNetworkingConfigValue_t opt; opt.SetPtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, MyStatusChangedFunc ); SteamNetworkingIPAddr localAddress; localAddress.Clear(); HSteamListenSocket hListenSock = SteamNetworkingSockets()->CreateListenSocketIP( localAddress, 1, &opt );

When accepting an incoming connection, there is no atomic way to switch the callback. However, if the connection is DOA, AcceptConnection() will fail, and you can fetch the state of the connection at that time.

If all connections and listen sockets can use the same callback, the simplest method is to set it globally before you create any listen sockets or connections.

k_ESteamNetworkingConfig_Callback_AuthStatusChanged

[global FnSteamNetAuthenticationStatusChanged] Callback that will be invoked when our auth state changes. If you use this, install the callback before creating any connections or listen sockets, and don’t change it. See: ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged

k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged

[global FnSteamRelayNetworkStatusChanged] Callback that will be invoked when our auth state changes. If you use this, install the callback before creating any connections or listen sockets, and don’t change it. See: ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged

k_ESteamNetworkingConfig_Callback_MessagesSessionRequest

[global FnSteamNetworkingMessagesSessionRequest] Callback that will be invoked when a peer wants to initiate a SteamNetworkingMessagesSessionRequest. See: ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest

k_ESteamNetworkingConfig_Callback_MessagesSessionFailed

[global FnSteamNetworkingMessagesSessionFailed] Callback that will be invoked when a session you have initiated, or accepted either fails to connect, or loses connection in some unexpected way. See: ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed

k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling

[global FnSteamNetworkingSocketsCreateConnectionSignaling] Callback that will be invoked when we need to create a signaling object for a connection initiated locally. See: ISteamNetworkingSockets::ConnectP2P, ISteamNetworkingMessages.

k_ESteamNetworkingConfig_Callback_FakeIPResult

[global FnSteamNetworkingFakeIPResult] Callback that’s invoked when a FakeIP allocation finishes. See: ISteamNetworkingSockets::BeginAsyncRequestFakeIP, ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult

k_ESteamNetworkingConfig_P2P_STUN_ServerList

[connection string] Comma-separated list of STUN servers that can be used for NAT piercing. If you set this to an empty string, NAT piercing will not be attempted. Also if “public” candidates are not allowed for P2P_Transport_ICE_Enable, then this is ignored.

k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable

[connection int32] What types of ICE candidates to share with the peer. See k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_xxx values

k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty

[connection int32] When selecting P2P transport, add various penalties to the scores for selected transports. (Route selection scores are on a scale of milliseconds. The score begins with the route ping time and is then adjusted.)

k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty

[connection int32] When selecting P2P transport, add various penalties to the scores for selected transports. (Route selection scores are on a scale of milliseconds. The score begins with the route ping time and is then adjusted.)

k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial

[int32 global] If the first N pings to a port all fail, mark that port as unavailable for a while, and try a different one. Some ISPs and routers may drop the first packet, so setting this to 1 may greatly disrupt communications.

k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail

[int32 global] If N consecutive pings to a port fail, after having received successful communication, mark that port as unavailable for a while, and try a different one.

k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate

[int32 global] Minimum number of lifetime pings we need to send, before we think our estimate is solid. The first ping to each cluster is very often delayed because of NAT, routers not having the best route, etc. Until we’ve sent a sufficient number of pings, our estimate is often inaccurate. Keep pinging until we get this many pings.

k_ESteamNetworkingConfig_SDRClient_SingleSocket

[int32 global] Set all steam datagram traffic to originate from the same local port. By default, we open up a new UDP socket (on a different local port) for each relay. This is slightly less optimal, but it works around some routers that don’t implement NAT properly. If you have intermittent problems talking to relays that might be NAT related, try toggling this flag

k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster

[global string] Code of relay cluster to force use. If not empty, we will only use relays in that cluster. E.g. ‘iad’

k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress

[connection string] For debugging, generate our own (unsigned) ticket, using the specified gameserver address. Router must be configured to accept unsigned tickets.

k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr

[global string] For debugging. Override list of relays from the config with this set (maybe just one). Comma-separated list.

k_ESteamNetworkingConfig_SDRClient_FakeClusterPing

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_LogLevel_AckRTT

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_LogLevel_PacketDecode

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_LogLevel_Message

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_LogLevel_PacketGaps

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_LogLevel_P2PRendezvous

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_LogLevel_SDRRelayPings

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfig_DELETED_EnumerateDevVars

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

k_ESteamNetworkingConfigValue__Force32Bit

[global string] For debugging. Force ping times to clusters to be the specified values. A comma separated list of = values. E.g. “sto=32,iad=100”

This is a dev configuration value, you probably should not let users modify it in production.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.