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:
ISteamNetworkingMessagesis an interface designed to make it easy to port UDP-based code to P2P use cases. (By UDP-based, we mean non-connection-oriented code, where each time you send a packet, you specify the recipient's address.)
What it does not do:
To get an idea of what the API is like, here are a few things to check out:
See 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 can probably still take advantage of these services! Contact us to get a console version of the code, and see the Steamworks documentation for more info.
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
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.