Facepunch.Steamworks Wiki

Steamworks.SteamNetworking

Fields

Called when packets can't get through to the specified user. All queued packets unsent at this point will be dropped, further attempts to send will retry making the connection (but will be dropped if we fail again).
static Action<SteamId, P2PSessionError> OnP2PConnectionFailed
This SteamId wants to send you a message. You should respond by calling AcceptP2PSessionWithUser if you want to recieve their messages
static Action<SteamId> OnP2PSessionRequest

Methods

This should be called in response to a OnP2PSessionRequest
static bool AcceptP2PSessionWithUser( SteamId user );
Allow or disallow P2P connects to fall back on Steam server relay if direct connection or NAT traversal can't be established. Applies to connections created after setting or old connections that need to reconnect.
static bool AllowP2PPacketRelay( bool allow );
This should be called when you're done communicating with a user, as this will free up all of the resources allocated for the connection under-the-hood. If the remote user tries to send data to you again, a new OnP2PSessionRequest callback will be po..
static bool CloseP2PSessionWithUser( SteamId user );
Checks if a P2P packet is available to read, and gets the size of the message if there is one.
static bool IsP2PPacketAvailable( int channel = 0 );
Reads in a packet that has been sent from another user via SendP2PPacket..
static bool ReadP2PPacket( byte* buffer, uint cbuf, uint size, SteamId steamid, int channel = 0 );
Sends a P2P packet to the specified user. This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections. NOTE: The first packet send may be delayed as the NAT-traversal code runs.
static bool SendP2PPacket( SteamId steamid, byte* data, uint length, int nChannel = 1, P2PSend sendType = Reliable );

Page Links


Special Pages


Wikis

?

Render Time: 16ms

Session 0
DB GetPage 3
Generate Html 0
SaveChanges 9
Render Body 0
Render Sidebar 1