Rise
The Vieneo Province
Loading...
Searching...
No Matches
steamnetworkingtypes.h File Reference
#include <string.h>
#include <stdint.h>
#include "steamtypes.h"
#include "steamclientpublic.h"
Include dependency graph for steamnetworkingtypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SteamNetworkingIPAddr
struct  SteamNetworkingIPAddr::IPv4MappedAddress
 RFC4038, section 4.2. More...
struct  SteamNetworkingIdentity
struct  SteamNetConnectionInfo_t
 Describe the state of a connection. More...
struct  SteamNetConnectionRealTimeStatus_t
struct  SteamNetConnectionRealTimeLaneStatus_t
 Quick status of a particular lane. More...
struct  SteamNetworkingMessage_t
 A message that has been received. More...
struct  SteamNetworkPingLocation_t
struct  SteamNetworkingConfigValue_t
struct  SteamNetworkingPOPIDRender
 Utility class for printing a SteamNetworkingPOPID. More...

Macros

#define STEAMNETWORKINGSOCKETS_STEAMAPI
#define STEAMNETWORKINGSOCKETS_INTERFACE   extern "C"

Typedefs

typedef void(*) FnSteamNetConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t *)
typedef void(*) FnSteamNetAuthenticationStatusChanged(SteamNetAuthenticationStatus_t *)
typedef void(*) FnSteamRelayNetworkStatusChanged(SteamRelayNetworkStatus_t *)
typedef void(*) FnSteamNetworkingMessagesSessionRequest(SteamNetworkingMessagesSessionRequest_t *)
typedef void(*) FnSteamNetworkingMessagesSessionFailed(SteamNetworkingMessagesSessionFailed_t *)
typedef void(*) FnSteamNetworkingFakeIPResult(SteamNetworkingFakeIPResult_t *)
typedef uint32 HSteamNetConnection
 Handle used to identify a connection to a remote host.
typedef uint32 HSteamListenSocket
typedef uint32 HSteamNetPollGroup
typedef char SteamNetworkingErrMsg[k_cchMaxSteamNetworkingErrMsg]
typedef uint32 SteamNetworkingPOPID
typedef int64 SteamNetworkingMicroseconds
typedef void(*) FSteamNetworkingSocketsDebugOutput(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg)
 Setup callback for debug output, and the desired verbosity you want.
typedef SteamNetworkingMessage_t ISteamNetworkingMessage
typedef SteamNetworkingErrMsg SteamDatagramErrMsg

Enumerations

enum  ESteamNetworkingAvailability {
  k_ESteamNetworkingAvailability_CannotTry = -102 , k_ESteamNetworkingAvailability_Failed = -101 , k_ESteamNetworkingAvailability_Previously = -100 , k_ESteamNetworkingAvailability_Retrying = -10 ,
  k_ESteamNetworkingAvailability_NeverTried = 1 , k_ESteamNetworkingAvailability_Waiting = 2 , k_ESteamNetworkingAvailability_Attempting = 3 , k_ESteamNetworkingAvailability_Current = 100 ,
  k_ESteamNetworkingAvailability_Unknown = 0 , k_ESteamNetworkingAvailability__Force32bit = 0x7fffffff
}
 Describe the status of a particular network resource. More...
enum  ESteamNetworkingIdentityType {
  k_ESteamNetworkingIdentityType_Invalid = 0 , k_ESteamNetworkingIdentityType_SteamID = 16 , k_ESteamNetworkingIdentityType_XboxPairwiseID = 17 , k_ESteamNetworkingIdentityType_SonyPSN = 18 ,
  k_ESteamNetworkingIdentityType_IPAddress = 1 , k_ESteamNetworkingIdentityType_GenericString = 2 , k_ESteamNetworkingIdentityType_GenericBytes = 3 , k_ESteamNetworkingIdentityType_UnknownType = 4 ,
  k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff
}
 Different methods of describing the identity of a network host. More...
enum  ESteamNetworkingFakeIPType {
  k_ESteamNetworkingFakeIPType_Invalid , k_ESteamNetworkingFakeIPType_NotFake , k_ESteamNetworkingFakeIPType_GlobalIPv4 , k_ESteamNetworkingFakeIPType_LocalIPv4 ,
  k_ESteamNetworkingFakeIPType__Force32Bit = 0x7fffffff
}
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 = 0x7fffffff
}
 High level connection status. More...
enum  ESteamNetConnectionEnd {
  k_ESteamNetConnectionEnd_Invalid = 0 , k_ESteamNetConnectionEnd_App_Min = 1000 , k_ESteamNetConnectionEnd_App_Generic = k_ESteamNetConnectionEnd_App_Min , k_ESteamNetConnectionEnd_App_Max = 1999 ,
  k_ESteamNetConnectionEnd_AppException_Min = 2000 , k_ESteamNetConnectionEnd_AppException_Generic = k_ESteamNetConnectionEnd_AppException_Min , k_ESteamNetConnectionEnd_AppException_Max = 2999 , k_ESteamNetConnectionEnd_Local_Min = 3000 ,
  k_ESteamNetConnectionEnd_Local_OfflineMode = 3001 , k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002 , k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003 , k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004 ,
  k_ESteamNetConnectionEnd_Local_Rights = 3005 , k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses = 3006 , k_ESteamNetConnectionEnd_Local_Max = 3999 , k_ESteamNetConnectionEnd_Remote_Min = 4000 ,
  k_ESteamNetConnectionEnd_Remote_Timeout = 4001 , k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002 , k_ESteamNetConnectionEnd_Remote_BadCert = 4003 , k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006 ,
  k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses = 4007 , k_ESteamNetConnectionEnd_Remote_Max = 4999 , k_ESteamNetConnectionEnd_Misc_Min = 5000 , k_ESteamNetConnectionEnd_Misc_Generic = 5001 ,
  k_ESteamNetConnectionEnd_Misc_InternalError = 5002 , k_ESteamNetConnectionEnd_Misc_Timeout = 5003 , k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005 , k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006 ,
  k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous = 5008 , k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall = 5009 , k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection = 5010 , k_ESteamNetConnectionEnd_Misc_Max = 5999 ,
  k_ESteamNetConnectionEnd__Force32Bit = 0x7fffffff
}
enum  ESteamNetworkingConfigScope {
  k_ESteamNetworkingConfig_Global = 1 , k_ESteamNetworkingConfig_SocketsInterface = 2 , k_ESteamNetworkingConfig_ListenSocket = 3 , k_ESteamNetworkingConfig_Connection = 4 ,
  k_ESteamNetworkingConfigScope__Force32Bit = 0x7fffffff
}
 Configuration values can be applied to different types of objects. More...
enum  ESteamNetworkingConfigDataType {
  k_ESteamNetworkingConfig_Int32 = 1 , k_ESteamNetworkingConfig_Int64 = 2 , k_ESteamNetworkingConfig_Float = 3 , k_ESteamNetworkingConfig_String = 4 ,
  k_ESteamNetworkingConfig_Ptr = 5 , k_ESteamNetworkingConfigDataType__Force32Bit = 0x7fffffff
}
enum  ESteamNetworkingConfigValue {
  k_ESteamNetworkingConfig_Invalid = 0 , k_ESteamNetworkingConfig_TimeoutInitial = 24 , k_ESteamNetworkingConfig_TimeoutConnected = 25 , k_ESteamNetworkingConfig_SendBufferSize = 9 ,
  k_ESteamNetworkingConfig_RecvBufferSize = 47 , k_ESteamNetworkingConfig_RecvBufferMessages = 48 , k_ESteamNetworkingConfig_RecvMaxMessageSize = 49 , k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket = 50 ,
  k_ESteamNetworkingConfig_ConnectionUserData = 40 , k_ESteamNetworkingConfig_SendRateMin = 10 , k_ESteamNetworkingConfig_SendRateMax = 11 , k_ESteamNetworkingConfig_NagleTime = 12 ,
  k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23 , k_ESteamNetworkingConfig_IPLocalHost_AllowWithoutAuth = 52 , k_ESteamNetworkingConfig_MTU_PacketSize = 32 , k_ESteamNetworkingConfig_MTU_DataSize = 33 ,
  k_ESteamNetworkingConfig_Unencrypted = 34 , k_ESteamNetworkingConfig_SymmetricConnect = 37 , k_ESteamNetworkingConfig_LocalVirtualPort = 38 , k_ESteamNetworkingConfig_DualWifi_Enable = 39 ,
  k_ESteamNetworkingConfig_EnableDiagnosticsUI = 46 , k_ESteamNetworkingConfig_SendTimeSincePreviousPacket = 59 , k_ESteamNetworkingConfig_FakePacketLoss_Send = 2 , k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3 ,
  k_ESteamNetworkingConfig_FakePacketLag_Send = 4 , k_ESteamNetworkingConfig_FakePacketLag_Recv = 5 , k_ESteamNetworkingConfig_FakePacketJitter_Send_Avg = 53 , k_ESteamNetworkingConfig_FakePacketJitter_Send_Max = 54 ,
  k_ESteamNetworkingConfig_FakePacketJitter_Send_Pct = 55 , k_ESteamNetworkingConfig_FakePacketJitter_Recv_Avg = 56 , k_ESteamNetworkingConfig_FakePacketJitter_Recv_Max = 57 , k_ESteamNetworkingConfig_FakePacketJitter_Recv_Pct = 58 ,
  k_ESteamNetworkingConfig_FakePacketReorder_Send = 6 , k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7 , k_ESteamNetworkingConfig_FakePacketReorder_Time = 8 , k_ESteamNetworkingConfig_FakePacketDup_Send = 26 ,
  k_ESteamNetworkingConfig_FakePacketDup_Recv = 27 , k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28 , k_ESteamNetworkingConfig_PacketTraceMaxBytes = 41 , k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate = 42 ,
  k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst = 43 , k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44 , k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45 , k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds = 51 ,
  k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged = 201 , k_ESteamNetworkingConfig_Callback_AuthStatusChanged = 202 , k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged = 203 , k_ESteamNetworkingConfig_Callback_MessagesSessionRequest = 204 ,
  k_ESteamNetworkingConfig_Callback_MessagesSessionFailed = 205 , k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling = 206 , k_ESteamNetworkingConfig_Callback_FakeIPResult = 207 , k_ESteamNetworkingConfig_P2P_STUN_ServerList = 103 ,
  k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable = 104 , k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty = 105 , k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106 , k_ESteamNetworkingConfig_P2P_TURN_ServerList = 107 ,
  k_ESteamNetworkingConfig_P2P_TURN_UserList = 108 , k_ESteamNetworkingConfig_P2P_TURN_PassList = 109 , k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation = 110 , k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19 ,
  k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20 , k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21 , k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22 , k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29 ,
  k_ESteamNetworkingConfig_SDRClient_DevTicket = 30 , k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31 , k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36 , k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN = 60 ,
  k_ESteamNetworkingConfig_LogLevel_AckRTT = 13 , k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14 , k_ESteamNetworkingConfig_LogLevel_Message = 15 , k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16 ,
  k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17 , k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18 , k_ESteamNetworkingConfig_ECN = 999 , k_ESteamNetworkingConfig_SDRClient_EnableTOSProbes = 998 ,
  k_ESteamNetworkingConfig_DELETED_EnumerateDevVars = 35 , k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff
}
 Configuration options. More...
enum  ESteamNetworkingGetConfigValueResult {
  k_ESteamNetworkingGetConfigValue_BadValue = -1 , k_ESteamNetworkingGetConfigValue_BadScopeObj = -2 , k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3 , k_ESteamNetworkingGetConfigValue_OK = 1 ,
  k_ESteamNetworkingGetConfigValue_OKInherited = 2 , k_ESteamNetworkingGetConfigValueResult__Force32Bit = 0x7fffffff
}
 Return value of ISteamNetworkintgUtils::GetConfigValue. More...
enum  ESteamNetworkingSocketsDebugOutputType {
  k_ESteamNetworkingSocketsDebugOutputType_None = 0 , k_ESteamNetworkingSocketsDebugOutputType_Bug = 1 , k_ESteamNetworkingSocketsDebugOutputType_Error = 2 , k_ESteamNetworkingSocketsDebugOutputType_Important = 3 ,
  k_ESteamNetworkingSocketsDebugOutputType_Warning = 4 , k_ESteamNetworkingSocketsDebugOutputType_Msg = 5 , k_ESteamNetworkingSocketsDebugOutputType_Verbose = 6 , k_ESteamNetworkingSocketsDebugOutputType_Debug = 7 ,
  k_ESteamNetworkingSocketsDebugOutputType_Everything = 8 , k_ESteamNetworkingSocketsDebugOutputType__Force32Bit = 0x7fffffff
}

Functions

SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString (const char *pszCode)
 Convert 3- or 4-character ID to 32-bit int.
template<int N>
void GetSteamNetworkingLocationPOPStringFromID (SteamNetworkingPOPID id, char(&szCode)[N])

Variables

const HSteamNetConnection k_HSteamNetConnection_Invalid = 0
const HSteamListenSocket k_HSteamListenSocket_Invalid = 0
const HSteamNetPollGroup k_HSteamNetPollGroup_Invalid = 0
const int k_cchMaxSteamNetworkingErrMsg = 1024
 Max length of diagnostic error message.
const int k_cchSteamNetworkingMaxConnectionCloseReason = 128
const int k_cchSteamNetworkingMaxConnectionDescription = 128
const int k_cchSteamNetworkingMaxConnectionAppName = 32
 Max length of the app's part of the description.
const int k_nSteamNetworkConnectionInfoFlags_Unauthenticated = 1
const int k_nSteamNetworkConnectionInfoFlags_Unencrypted = 2
const int k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers = 4
const int k_nSteamNetworkConnectionInfoFlags_Fast = 8
const int k_nSteamNetworkConnectionInfoFlags_Relayed = 16
const int k_nSteamNetworkConnectionInfoFlags_DualWifi = 32
const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024
const int k_nSteamNetworkingSend_Unreliable = 0
const int k_nSteamNetworkingSend_NoNagle = 1
const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle
const int k_nSteamNetworkingSend_NoDelay = 4
const int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoDelay|k_nSteamNetworkingSend_NoNagle
const int k_nSteamNetworkingSend_Reliable = 8
const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle
const int k_nSteamNetworkingSend_UseCurrentThread = 16
const int k_nSteamNetworkingSend_AutoRestartBrokenSession = 32
const int k_cchMaxSteamNetworkingPingLocationString = 1024
const int k_nSteamNetworkingPing_Failed = -1
 Special values that are returned by some functions that return a ping.
const int k_nSteamNetworkingPing_Unknown = -2
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default = -1
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable = 0
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay = 1
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private = 2
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public = 4
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All = 0x7fffffff
const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v'
 The POPID "dev" is used in non-production environments for testing.

Macro Definition Documentation

◆ STEAMNETWORKINGSOCKETS_INTERFACE

#define STEAMNETWORKINGSOCKETS_INTERFACE   extern "C"

Definition at line 38 of file steamnetworkingtypes.h.

◆ STEAMNETWORKINGSOCKETS_STEAMAPI

#define STEAMNETWORKINGSOCKETS_STEAMAPI

Definition at line 19 of file steamnetworkingtypes.h.

Typedef Documentation

◆ FnSteamNetAuthenticationStatusChanged

typedef void(*) FnSteamNetAuthenticationStatusChanged(SteamNetAuthenticationStatus_t *)

Definition at line 61 of file steamnetworkingtypes.h.

◆ FnSteamNetConnectionStatusChanged

typedef void(*) FnSteamNetConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t *)

Definition at line 60 of file steamnetworkingtypes.h.

◆ FnSteamNetworkingFakeIPResult

typedef void(*) FnSteamNetworkingFakeIPResult(SteamNetworkingFakeIPResult_t *)

Definition at line 65 of file steamnetworkingtypes.h.

◆ FnSteamNetworkingMessagesSessionFailed

typedef void(*) FnSteamNetworkingMessagesSessionFailed(SteamNetworkingMessagesSessionFailed_t *)

Definition at line 64 of file steamnetworkingtypes.h.

◆ FnSteamNetworkingMessagesSessionRequest

typedef void(*) FnSteamNetworkingMessagesSessionRequest(SteamNetworkingMessagesSessionRequest_t *)

Definition at line 63 of file steamnetworkingtypes.h.

◆ FnSteamRelayNetworkStatusChanged

typedef void(*) FnSteamRelayNetworkStatusChanged(SteamRelayNetworkStatus_t *)

Definition at line 62 of file steamnetworkingtypes.h.

◆ FSteamNetworkingSocketsDebugOutput

typedef void(*) FSteamNetworkingSocketsDebugOutput(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg)

Setup callback for debug output, and the desired verbosity you want.

Definition at line 1829 of file steamnetworkingtypes.h.

◆ HSteamListenSocket

Handle used to identify a "listen socket". Unlike traditional Berkeley sockets, a listen socket and a connection are two different abstractions.

Definition at line 74 of file steamnetworkingtypes.h.

◆ HSteamNetConnection

Handle used to identify a connection to a remote host.

Definition at line 68 of file steamnetworkingtypes.h.

◆ HSteamNetPollGroup

Handle used to identify a poll group, used to query many connections at once efficiently.

Definition at line 79 of file steamnetworkingtypes.h.

◆ ISteamNetworkingMessage

◆ SteamDatagramErrMsg

◆ SteamNetworkingErrMsg

typedef char SteamNetworkingErrMsg[k_cchMaxSteamNetworkingErrMsg]

Used to return English-language diagnostic error messages to caller. (For debugging or spewing to a console, etc. Not intended for UI.)

Definition at line 87 of file steamnetworkingtypes.h.

◆ SteamNetworkingMicroseconds

A local timestamp. You can subtract two timestamps to get the number of elapsed microseconds. This is guaranteed to increase over time during the lifetime of a process, but not globally across runs. You don't need to worry about the value wrapping around. Note that the underlying clock might not actually have microsecond resolution.

Definition at line 98 of file steamnetworkingtypes.h.

◆ SteamNetworkingPOPID

Identifier used for a network location point of presence. (E.g. a Valve data center.) Typically you won't need to directly manipulate these.

Definition at line 91 of file steamnetworkingtypes.h.

Enumeration Type Documentation

◆ ESteamNetConnectionEnd

Enumerate various causes of connection termination. These are designed to work similar to HTTP error codes: the numeric range gives you a rough classification as to the source of the problem.

Enumerator
k_ESteamNetConnectionEnd_Invalid 
k_ESteamNetConnectionEnd_App_Min 
k_ESteamNetConnectionEnd_App_Generic 
k_ESteamNetConnectionEnd_App_Max 
k_ESteamNetConnectionEnd_AppException_Min 
k_ESteamNetConnectionEnd_AppException_Generic 
k_ESteamNetConnectionEnd_AppException_Max 
k_ESteamNetConnectionEnd_Local_Min 
k_ESteamNetConnectionEnd_Local_OfflineMode 
k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity 
k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay 
k_ESteamNetConnectionEnd_Local_NetworkConfig 
k_ESteamNetConnectionEnd_Local_Rights 
k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses 
k_ESteamNetConnectionEnd_Local_Max 
k_ESteamNetConnectionEnd_Remote_Min 
k_ESteamNetConnectionEnd_Remote_Timeout 
k_ESteamNetConnectionEnd_Remote_BadCrypt 
k_ESteamNetConnectionEnd_Remote_BadCert 
k_ESteamNetConnectionEnd_Remote_BadProtocolVersion 
k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses 
k_ESteamNetConnectionEnd_Remote_Max 
k_ESteamNetConnectionEnd_Misc_Min 
k_ESteamNetConnectionEnd_Misc_Generic 
k_ESteamNetConnectionEnd_Misc_InternalError 
k_ESteamNetConnectionEnd_Misc_Timeout 
k_ESteamNetConnectionEnd_Misc_SteamConnectivity 
k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient 
k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous 
k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall 
k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection 
k_ESteamNetConnectionEnd_Misc_Max 
k_ESteamNetConnectionEnd__Force32Bit 

Definition at line 457 of file steamnetworkingtypes.h.

◆ ESteamNetworkingAvailability

Describe the status of a particular network resource.

Enumerator
k_ESteamNetworkingAvailability_CannotTry 
k_ESteamNetworkingAvailability_Failed 
k_ESteamNetworkingAvailability_Previously 
k_ESteamNetworkingAvailability_Retrying 
k_ESteamNetworkingAvailability_NeverTried 
k_ESteamNetworkingAvailability_Waiting 
k_ESteamNetworkingAvailability_Attempting 
k_ESteamNetworkingAvailability_Current 
k_ESteamNetworkingAvailability_Unknown 
k_ESteamNetworkingAvailability__Force32bit 

Definition at line 101 of file steamnetworkingtypes.h.

◆ ESteamNetworkingConfigDataType

Enumerator
k_ESteamNetworkingConfig_Int32 
k_ESteamNetworkingConfig_Int64 
k_ESteamNetworkingConfig_Float 
k_ESteamNetworkingConfig_String 
k_ESteamNetworkingConfig_Ptr 
k_ESteamNetworkingConfigDataType__Force32Bit 

Definition at line 1125 of file steamnetworkingtypes.h.

◆ ESteamNetworkingConfigScope

Configuration values can be applied to different types of objects.

Enumerator
k_ESteamNetworkingConfig_Global 

Get/set global option, or defaults. Even options that apply to more specific scopes have global scope, and you may be able to just change the global defaults. If you need different settings per connection (for example), then you will need to set those options at the more specific scope.

k_ESteamNetworkingConfig_SocketsInterface 

Some options are specific to a particular interface. Note that all connection and listen socket settings can also be set at the interface level, and they will apply to objects created through those interfaces.

k_ESteamNetworkingConfig_ListenSocket 

Options for a listen socket. Listen socket options can be set at the interface layer, if you have multiple listen sockets and they all use the same options. You can also set connection options on a listen socket, and they set the defaults for all connections accepted through this listen socket. (They will be used if you don't set a connection option.)

k_ESteamNetworkingConfig_Connection 

Options for a specific connection.

k_ESteamNetworkingConfigScope__Force32Bit 

Definition at line 1097 of file steamnetworkingtypes.h.

◆ ESteamNetworkingConfigValue

Configuration options.

Enumerator
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_RecvBufferSize 

[connection int32] Upper limit on total size (in bytes) of received messages that will be buffered waiting to be processed by the application. If this limit is exceeded, packets will be dropped. This is to protect us from a malicious peer flooding us with messages faster than we can process them.

This must be bigger than k_ESteamNetworkingConfig_RecvMaxMessageSize

k_ESteamNetworkingConfig_RecvBufferMessages 

[connection int32] Upper limit on the number of received messages that will that will be buffered waiting to be processed by the application. If this limit is exceeded, packets will be dropped. This is to protect us from a malicious peer flooding us with messages faster than we can pull them off the wire.

k_ESteamNetworkingConfig_RecvMaxMessageSize 

[connection int32] Maximum message size that we are willing to receive. if a client attempts to send us a message larger than this, the connection will be immediately closed.

Default is 512k (524288 bytes). Note that the peer needs to be able to send a message this big. (See k_cbMaxSteamNetworkingSocketsMessageSizeSend.)

k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket 

[connection int32] Max number of message segments that can be received in a single UDP packet. While decoding a packet, if the number of segments exceeds this, we will abort further packet processing.

The default is effectively unlimited. If you know that you very rarely send small packets, you can protect yourself from malicious senders by lowering this number.

In particular, if you are NOT using the reliability layer and are only using SteamNetworkingSockets for datagram transport, setting this to a very low number may be beneficial. (We recommend a value of 2.) Make sure your sender disables Nagle!

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:

k_ESteamNetworkingConfig_SendRateMin 

[connection int32] Minimum/maximum send rate clamp, in bytes/sec. At the time of this writing these two options should always be set to the same value, to manually configure a specific send rate. The default value is 256K. Eventually we hope to have the library estimate the bandwidth of the channel and set the send rate to that estimated bandwidth, and these values will only set limits on that send rate.

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

0: Don't attempt or accept unauthorized connections 1: Attempt authorization when connecting, and allow unauthorized peers, but emit warnings 2: don't attempt authentication, or complain if peer is unauthenticated

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

k_ESteamNetworkingConfig_IPLocalHost_AllowWithoutAuth 

[connection int32] The same as IP_AllowWithoutAuth, but will only apply for connections to/from localhost addresses. Whichever value is larger (more permissive) will be used.

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_SendTimeSincePreviousPacket 

[connection int32] Send of time-since-previous-packet values in each UDP packet. This add a small amount of packet overhead but allows for detailed jitter measurements to be made by the receiver.

  • 0: disables the sending
  • 1: enables sending
  • -1: (the default) Use the default for the connection type. For plain UDP connections, this is disabled, and for relayed connections, it is enabled. Note that relays always send the value.
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 
k_ESteamNetworkingConfig_FakePacketLag_Send 

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

k_ESteamNetworkingConfig_FakePacketLag_Recv 
k_ESteamNetworkingConfig_FakePacketJitter_Send_Avg 

Simulated jitter/clumping.

For each packet, a jitter value is determined (which may be zero). This amount is added as extra delay to the packet. When a subsequent packet is queued, it receives its own random jitter amount from the current time. if this would result in the packets being delivered out of order, the later packet queue time is adjusted to happen after the first packet. Thus simulating jitter by itself will not reorder packets, but it can "clump" them.

- Avg: A random jitter time is generated using an exponential

distribution using this value as the mean (ms). The default is zero, which disables random jitter.

  • Max: Limit the random jitter time to this value (ms).
    • Pct: odds (0-100) that a random jitter value for the packet will be generated. Otherwise, a jitter value of zero is used, and the packet will only be delayed by the jitter system if necessary to retain order, due to the jitter of a previous packet.

All values are [global float]

Fake jitter is simulated after fake lag, but before reordering.

k_ESteamNetworkingConfig_FakePacketJitter_Send_Max 
k_ESteamNetworkingConfig_FakePacketJitter_Send_Pct 
k_ESteamNetworkingConfig_FakePacketJitter_Recv_Avg 
k_ESteamNetworkingConfig_FakePacketJitter_Recv_Max 
k_ESteamNetworkingConfig_FakePacketJitter_Recv_Pct 
k_ESteamNetworkingConfig_FakePacketReorder_Send 

[global float] 0-100 Percentage of packets we will add additional delay to. If other packet(s) are sent/received within this delay window (that doesn't also randomly receive the same extra delay), then the packets become reordered.

This mechanism is primarily intended to generate out-of-order packets. To simulate random jitter, use the FakePacketJitter. Fake packet reordering is applied after fake lag and jitter

k_ESteamNetworkingConfig_FakePacketReorder_Recv 
k_ESteamNetworkingConfig_FakePacketReorder_Time 

[global int32] Extra delay, in ms, to apply to reordered packets. The same time value is used for sending and receiving.

k_ESteamNetworkingConfig_FakePacketDup_Send 

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

k_ESteamNetworkingConfig_FakePacketDup_Recv 
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_OutOfOrderCorrectionWindowMicroseconds 
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 
k_ESteamNetworkingConfig_P2P_TURN_ServerList 
k_ESteamNetworkingConfig_P2P_TURN_UserList 
k_ESteamNetworkingConfig_P2P_TURN_PassList 
k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation 
k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial 

[global int32] 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 

[global int32] 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 

[global int32] 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 

[global int32] 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_DevTicket 

[connection string] For development, a base-64 encoded ticket generated using the cert tool. This can be used to connect to a gameserver via SDR without a ticket generated using the game coordinator. (You will still need a key that is trusted for your app, however.)

This can also be passed using the SDR_DEVTICKET environment variable

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 <cluster>=<ms> 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_SDRClient_LimitPingProbesToNearestN 

[global int32] When probing the SteamDatagram network, we limit exploration to the closest N POPs, based on our current best approximated ping to that POP.

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_ECN 
k_ESteamNetworkingConfig_SDRClient_EnableTOSProbes 
k_ESteamNetworkingConfig_DELETED_EnumerateDevVars 
k_ESteamNetworkingConfigValue__Force32Bit 

Definition at line 1137 of file steamnetworkingtypes.h.

◆ ESteamNetworkingConnectionState

High level connection status.

Enumerator
k_ESteamNetworkingConnectionState_None 

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

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

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

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

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

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

k_ESteamNetworkingConnectionState_FinWait 

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 

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 

Connection is completely inactive and ready to be destroyed.

k_ESteamNetworkingConnectionState__Force32Bit 

Definition at line 350 of file steamnetworkingtypes.h.

◆ ESteamNetworkingFakeIPType

"Fake IPs" are assigned to hosts, to make it easier to interface with older code that assumed all hosts will have an IPv4 address

Enumerator
k_ESteamNetworkingFakeIPType_Invalid 
k_ESteamNetworkingFakeIPType_NotFake 
k_ESteamNetworkingFakeIPType_GlobalIPv4 
k_ESteamNetworkingFakeIPType_LocalIPv4 
k_ESteamNetworkingFakeIPType__Force32Bit 

Definition at line 183 of file steamnetworkingtypes.h.

◆ ESteamNetworkingGetConfigValueResult

Return value of ISteamNetworkintgUtils::GetConfigValue.

Enumerator
k_ESteamNetworkingGetConfigValue_BadValue 
k_ESteamNetworkingGetConfigValue_BadScopeObj 
k_ESteamNetworkingGetConfigValue_BufferTooSmall 
k_ESteamNetworkingGetConfigValue_OK 
k_ESteamNetworkingGetConfigValue_OKInherited 
k_ESteamNetworkingGetConfigValueResult__Force32Bit 

Definition at line 1796 of file steamnetworkingtypes.h.

◆ ESteamNetworkingIdentityType

Different methods of describing the identity of a network host.

Enumerator
k_ESteamNetworkingIdentityType_Invalid 
k_ESteamNetworkingIdentityType_SteamID 
k_ESteamNetworkingIdentityType_XboxPairwiseID 
k_ESteamNetworkingIdentityType_SonyPSN 
k_ESteamNetworkingIdentityType_IPAddress 
k_ESteamNetworkingIdentityType_GenericString 
k_ESteamNetworkingIdentityType_GenericBytes 
k_ESteamNetworkingIdentityType_UnknownType 
k_ESteamNetworkingIdentityType__Force32bit 

Definition at line 132 of file steamnetworkingtypes.h.

◆ ESteamNetworkingSocketsDebugOutputType

Detail level for diagnostic output callback. See ISteamNetworkingUtils::SetDebugOutputFunction

Enumerator
k_ESteamNetworkingSocketsDebugOutputType_None 
k_ESteamNetworkingSocketsDebugOutputType_Bug 
k_ESteamNetworkingSocketsDebugOutputType_Error 
k_ESteamNetworkingSocketsDebugOutputType_Important 
k_ESteamNetworkingSocketsDebugOutputType_Warning 
k_ESteamNetworkingSocketsDebugOutputType_Msg 
k_ESteamNetworkingSocketsDebugOutputType_Verbose 
k_ESteamNetworkingSocketsDebugOutputType_Debug 
k_ESteamNetworkingSocketsDebugOutputType_Everything 
k_ESteamNetworkingSocketsDebugOutputType__Force32Bit 

Definition at line 1813 of file steamnetworkingtypes.h.

Function Documentation

◆ CalculateSteamNetworkingPOPIDFromString()

SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString ( const char * pszCode)
inline

Convert 3- or 4-character ID to 32-bit int.

Definition at line 1836 of file steamnetworkingtypes.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSteamNetworkingLocationPOPStringFromID()

template<int N>
void GetSteamNetworkingLocationPOPStringFromID ( SteamNetworkingPOPID id,
char(&) szCode[N] )
inline

Unpack integer to string representation, including terminating '\0'

See also SteamNetworkingPOPIDRender

Definition at line 1864 of file steamnetworkingtypes.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ k_cbMaxSteamNetworkingSocketsMessageSizeSend

const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024

Max size of a single message that we can SEND. Note: We might be wiling to receive larger messages, and our peer might, too.

Definition at line 841 of file steamnetworkingtypes.h.

◆ k_cchMaxSteamNetworkingErrMsg

const int k_cchMaxSteamNetworkingErrMsg = 1024

Max length of diagnostic error message.

Definition at line 83 of file steamnetworkingtypes.h.

◆ k_cchMaxSteamNetworkingPingLocationString

const int k_cchMaxSteamNetworkingPingLocationString = 1024

Max possible length of a ping location, in string format. This is an extremely conservative worst case value which leaves room for future syntax enhancements. Most strings in practice are a lot shorter. If you are storing many of these, you will very likely benefit from using dynamic memory.

Definition at line 1086 of file steamnetworkingtypes.h.

◆ k_cchSteamNetworkingMaxConnectionAppName

const int k_cchSteamNetworkingMaxConnectionAppName = 32

Max length of the app's part of the description.

Definition at line 663 of file steamnetworkingtypes.h.

◆ k_cchSteamNetworkingMaxConnectionCloseReason

const int k_cchSteamNetworkingMaxConnectionCloseReason = 128

Max length, in bytes (including null terminator) of the reason string when a connection is closed.

Definition at line 656 of file steamnetworkingtypes.h.

◆ k_cchSteamNetworkingMaxConnectionDescription

const int k_cchSteamNetworkingMaxConnectionDescription = 128

Max length, in bytes (include null terminator) of debug description of a connection.

Definition at line 660 of file steamnetworkingtypes.h.

◆ k_HSteamListenSocket_Invalid

const HSteamListenSocket k_HSteamListenSocket_Invalid = 0

Definition at line 75 of file steamnetworkingtypes.h.

◆ k_HSteamNetConnection_Invalid

const HSteamNetConnection k_HSteamNetConnection_Invalid = 0

Definition at line 69 of file steamnetworkingtypes.h.

◆ k_HSteamNetPollGroup_Invalid

const HSteamNetPollGroup k_HSteamNetPollGroup_Invalid = 0

Definition at line 80 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkConnectionInfoFlags_DualWifi

const int k_nSteamNetworkConnectionInfoFlags_DualWifi = 32

Definition at line 670 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkConnectionInfoFlags_Fast

const int k_nSteamNetworkConnectionInfoFlags_Fast = 8

Definition at line 668 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers

const int k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers = 4

Definition at line 667 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkConnectionInfoFlags_Relayed

const int k_nSteamNetworkConnectionInfoFlags_Relayed = 16

Definition at line 669 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkConnectionInfoFlags_Unauthenticated

const int k_nSteamNetworkConnectionInfoFlags_Unauthenticated = 1

Definition at line 665 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkConnectionInfoFlags_Unencrypted

const int k_nSteamNetworkConnectionInfoFlags_Unencrypted = 2

Definition at line 666 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All

const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All = 0x7fffffff

Definition at line 1729 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default

const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default = -1

Definition at line 1724 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable

const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable = 0

Definition at line 1725 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private

const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private = 2

Definition at line 1727 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public

const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public = 4

Definition at line 1728 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay

const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay = 1

Definition at line 1726 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingPing_Failed

const int k_nSteamNetworkingPing_Failed = -1

Special values that are returned by some functions that return a ping.

Definition at line 1089 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingPing_Unknown

const int k_nSteamNetworkingPing_Unknown = -2

Definition at line 1090 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_AutoRestartBrokenSession

const int k_nSteamNetworkingSend_AutoRestartBrokenSession = 32

Definition at line 1057 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_NoDelay

const int k_nSteamNetworkingSend_NoDelay = 4

Definition at line 992 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_NoNagle

const int k_nSteamNetworkingSend_NoNagle = 1

Definition at line 980 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_Reliable

const int k_nSteamNetworkingSend_Reliable = 8

Definition at line 1016 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_ReliableNoNagle

const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle

Definition at line 1021 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_Unreliable

const int k_nSteamNetworkingSend_Unreliable = 0

Definition at line 963 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_UnreliableNoDelay

Definition at line 1005 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_UnreliableNoNagle

const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle

Definition at line 987 of file steamnetworkingtypes.h.

◆ k_nSteamNetworkingSend_UseCurrentThread

const int k_nSteamNetworkingSend_UseCurrentThread = 16

Definition at line 1036 of file steamnetworkingtypes.h.

◆ k_SteamDatagramPOPID_dev

const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v'

The POPID "dev" is used in non-production environments for testing.

Definition at line 1875 of file steamnetworkingtypes.h.