Structs
Lower level networking API.
Misc networking utilities for checking the local networking environment and estimating pings.
A struct used to describe our readiness to participate in authenticated, encrypted communication. In order to do this we need:
Describe the state of a connection.
Quick status of a particular lane
Quick connection state, pared down to something you could call more frequently without it being too big of a perf hit.
This callback is posted whenever a connection is created, destroyed, or changes state. The m_info field will contain a complete description of the connection at the time the change occurred and the callback was posted. In particular, m_eState will have the new connection state.
Object that describes a “location” on the Internet with sufficient detail that we can reasonably estimate an upper bound on the ping between the two hosts, even if a direct route between the hosts is not possible, and the connection must be routed through the Steam Datagram Relay network. This does not contain any information that identifies the host. Indeed, if two hosts are in the same building or otherwise have nearly identical networking characteristics, then it’s valid to use the same location object for both of them.
In a few places we need to set configuration options on listen sockets and connections, and have them take effect before the listen socket or connection really starts doing anything. Creating the object and then setting the options “immediately” after creation doesn’t work completely, because network packets could be received between the time the object is created and when the options are applied. To set options at creation time in a reliable way, they must be passed to the creation function. This structure is used to pass those options.
Store an IP and port. IPv6 is always used; IPv4 is represented using “IPv4-mapped” addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd (RFC 4291 section 2.5.5.2.)
Utility class for printing a SteamNetworkingIPAddrRender.
RFC4038, section 4.2
An abstract way to represent the identity of a network host. All identities can be represented as simple string. Furthermore, this string representation is actually used on the wire in several places, even though it is less efficient, in order to facilitate forward compatibility. (Old client code can handle an identity type that it doesn’t understand.)
Utility class for printing a SteamNetworkingIdentity. E.g. printf( “Identity is ‘%s’\n”, SteamNetworkingIdentityRender( identity ).c_str() );
A message that has been received.
Utility class for printing a SteamNetworkingPOPID.
A struct used to describe our readiness to use the relay network. To do this we first need to fetch the network configuration, which describes what POPs are available.
Enums
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.
Describe the status of a particular network resource
Configuration values can be applied to different types of objects.
Configuration options
High level connection status
“Fake IPs” are assigned to hosts, to make it easier to interface with older code that assumed all hosts will have an IPv4 address
Return value of ISteamNetworkintgUtils::GetConfigValue
Different methods of describing the identity of a network host
Detail level for diagnostic output callback. See ISteamNetworkingUtils::SetDebugOutputFunction
Constants
The POPID “dev” is used in non-production environments for testing.
Max size of a single message that we can SEND. Note: We might be wiling to receive larger messages, and our peer might, too.
Max length of diagnostic error message
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.
Max length of the app’s part of the description
Max length, in bytes (including null terminator) of the reason string when a connection is closed.
Max length, in bytes (include null terminator) of debug description of a connection.
Special values that are returned by some functions that return a ping.
Functions
Set a configuration value, using a struct to pass the value. (This is just a convenience shortcut; see below for the implementation and a little insight into how SteamNetworkingConfigValue_t is used when setting config options during listen socket and connection creation.)
Create an ISteamNetworkingConnectionSignaling object from plain C primitives.
Same as SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal, but using plain C primitives.
Classify address as FakeIP. This function never returns k_ESteamNetworkingFakeIPType_Invalid.
Parse back a string that was generated using ToString. If we don’t understand the
string, but it looks “reasonable” (it matches the pattern type:
Print to a human-readable string. This is suitable for debug messages
or any other time you need to encode the identity as a string. It has a
URL-like format (type:
Custom memory allocation methods. If you call this, you MUST call it exactly once, before calling any other API function. Most allocations will pass through these, especially all allocations that are per-connection. A few allocations might still go to the default CRT malloc and operator new. To use this, you must compile the library with STEAMNETWORKINGSOCKETS_ENABLE_MEM_OVERRIDE
Type Definitions
Setup callback for debug output, and the desired verbosity you want.
Handle used to identify a “listen socket”. Unlike traditional Berkeley sockets, a listen socket and a connection are two different abstractions.
Handle used to identify a connection to a remote host.
Handle used to identify a poll group, used to query many connections at once efficiently.
A message that has been received.
Used to return English-language diagnostic error messages to caller. (For debugging or spewing to a console, etc. Not intended for UI.)
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.
Identifier used for a network location point of presence. (E.g. a Valve data center.) Typically you won’t need to directly manipulate these.