P2P Networking
We advise against using this. It may be changed or removed in a future update.
This has been depreceated and https://wiki.facepunch.com/steamworks/SteamNetworkingSockets should be used instead.
Steam has a mechanism allowing you to send packets to another Steam user.
It's totally feasible to create a game's netcode using this system.
In the past we used this in Rust to send voice communications instead of bouncing it off the server. We ultimately stopped doing this because it revealed your IP.
Sending Messages
Receiving Messages
You need to set up a callback so you can authorize who can send you messages
Then just call something like this regularly
Your HandleMessageFrom function should look like this
Further Reading
There are less garbage creating versions of some of the functions here on the SteamNetworking class.
Although the p2p stuff is easy and will work out for a lot of situations, you should look at SteamNetworkingSockets if you're planning to make a game with client/server architecture with 10+ players sending updates multiple times a second.