Reliable & unreliable messages over UDP. Robust message fragmentation & reassembly. P2P networking / NAT traversal. Encryption.
GameNetworkingSockets is a basic transport layer for games. The features are:
ISteamNetworkingSockets::ConfigureConnectionLanes
.ISteamNetworkingMessages
is anWhat it does not do:
To get an idea of what the API is like, here are a few things to check out:
ISteamNetworkingSockets
is thesteamnetworkingtypes.h
has miscSee BUILDING for more information.
The library was written in C++, but there is also a plain C interface
to facilitate binding to other languages.
Third party language bindings:
The main interface class is named SteamNetworkingSockets, and many files have
“steam” in their name. But Steam is not needed. If you don’t make games or
aren’t on Steam, feel free to use this code for whatever purpose you want.
The reason for “Steam” in the names is that this provides a subset of the
functionality of the API
with the same name in the Steamworks SDK. Our main
reason for releasing this code is so that developers won’t have any hesitation
coding to the API in the Steamworks SDK. On Steam, you will link against the
Steamworks version, and you can access the additional services provided by
the Steam Datagram Relay
network. On other platforms and stores, as long as you ship a version of your
game on Steam, you might be able to take advantage of these services. See
the Steamworks documentation for more information. Because this is a live
service, and we need to control our security and backward compatibility burden,
at this time we are not able to offer access to SDR on other platforms to all
partners.
If you aren’t a Steam partner, or don’t have a version of your game on Steam,
then use this opensource version of the API and take advantage of the permissive
license to do whatever you want. We want you to take maximum advantage of the
features in the Steamworks version. That won’t happen if this API is a weird
“wart” that’s hidden behind #ifdef STEAM
, which is why we’re making this
opensource version available.
The desire to match the Steamworks SDK also explains a somewhat anachronistic
coding style and weird directory layout. This project is kept in sync with the
Steam code here at Valve. When we extracted the code from the much larger
codebase, we had to do some relatively gross hackery. The files in folders
named tier0
, tier1
, vstdlib
, common
, etc have especially suffered
trauma. Also if you see code that appears to have unnecessary layers of
abstraction, it’s probably because those layers are needed to support relayed
connection types or some part of the Steamworks SDK.
Did you find a security vulnerability? Please inform us responsibly; you may
be eligible for a bug bounty. See the security policy for more
information.