ISteamNetworkingSockets.ConnectP2PCustomSignaling

Create a P2P "client" connection that does signaling over a custom rendezvous/signaling channel.

pSignaling points to a new object that you create just for this connection. It must stay valid until Release() is called. Once you pass the object to this function, it assumes ownership. Release() will be called from within the function call if the call fails. Furthermore, until Release() is called, you should be prepared for methods to be invoked on your object from any thread! You need to make sure your object is threadsafe! Furthermore, you should make sure that dispatching the methods is done as quickly as possible.

This function will immediately construct a connection in the "connecting" state. Soon after (perhaps before this function returns, perhaps in another thread), the connection will begin sending signaling messages by calling ISteamNetworkingConnectionSignaling::SendSignal.

When the remote peer accepts the connection (See ISteamNetworkingSignalingRecvContext::OnConnectRequest), it will begin sending signaling messages. When these messages are received, you can pass them to the connection using ReceivedP2PCustomSignal.

If you know the identity of the peer that you expect to be on the other end, you can pass their identity to improve debug output or just detect bugs. If you don't know their identity yet, you can pass NULL, and their identity will be established in the connection handshake.

If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes

If you need to set any initial config options, pass them here. See SteamNetworkingConfigValue_t for more about why this is preferable to setting the options "immediately" after creation.

Meta