Structs

Internal structure used in manual callback dispatch

the Steamworks SDK. Please see ISteamNetworkingSockets and ISteamNetworkingMessages

The non-connection-oriented interface to send and receive messages (whether they be “clients” or “servers”).

Lower level networking API.

Misc networking utilities for checking the local networking environment and estimating pings.

Store key/value pair used in matchmaking queries.

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.

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.

Posted when we fail to establish a connection, or we detect that communications have been disrupted it an unusual way. There is no notification when a peer proactively closes the session. (“Closed by peer” is not a concept of UDP-style communications, and SteamNetworkingMessages is primarily intended to make porting UDP code easy.)

Posted when a remote host is sending us a message, and we do not already have a session with them

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

Pass to SteamGameServer_Init to indicate that the same UDP port will be used for game traffic UDP queries for server browser pings and LAN discovery. In this case, Steam will not open up a socket to handle server browser queries, and you must use ISteamGameServer::HandleIncomingPacket and ISteamGameServer::GetNextOutgoingPacket to handle packets related to server discovery on your socket.

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.

Statics

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

You must call this after dispatching the callback, if SteamAPI_ManualDispatch_GetNextCallback returns true.

Return the call result for the specified call on the specified pipe. You really should only call this in a handler for SteamAPICallCompleted_t callback.

Fetch the next pending callback on the given pipe, if any. If a callback is available, true is returned and the structure is populated. In this case, you MUST call SteamAPI_ManualDispatch_FreeLastCallback (after dispatching the callback) before calling SteamAPI_ManualDispatch_GetNextCallback again.

Inform the API that you wish to use manual event dispatch. This must be called after SteamAPI_Init, but before you use any of the other manual dispatch functions below.

Perform certain periodic actions that need to be performed.

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: and doesn’t have any funky characters, etc), then we will return true, and the type is set to k_ESteamNetworkingIdentityType_UnknownType. false will only be returned if the string looks invalid.

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:). Your buffer should be at least k_cchMaxString bytes big to avoid truncation.

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.

Unions