ISteamNetworkingSockets.BeginAsyncRequestFakeIP

Begin asynchronous process of allocating a fake IPv4 address that other peers can use to contact us via P2P. IP addresses returned by this function are globally unique for a given appid.

nNumPorts is the numbers of ports you wish to reserve. This is useful for the same reason that listening on multiple UDP ports is useful for different types of traffic. Because these allocations come from a global namespace, there is a relatively strict limit on the maximum number of ports you may request. (At the time of this writing, the limit is 4.) The Port assignments are *not* guaranteed to have any particular order or relationship! Do *not* assume they are contiguous, even though that may often occur in practice.

Returns false if a request was already in progress, true if a new request was started. A SteamNetworkingFakeIP_t will be posted when the request completes.

You can call this before you are logged in. For gameservers, doing so is *required*, and all places where your public IP appears (such as the server browser) will be replaced by the FakeIP, and the fake port at index 0. A failure will not be posted (using SteamNetworkingFakeIP_t) unless we get logged in, and then the request fails. Furthermore, it is assumed that FakeIP allocation is essential for your application to function, and so failure will not be reported until *several* retries have been attempted, possibly lasting several minutes. It is highly recommended to treat failure as fatal.

To communicate using a connection-oriented (TCP-style) API: - Server creates a listen socket using CreateListenSocketP2PFakeIP - Client connects using ConnectByIPAddress, passing in the FakeIP address. - The connection will behave mostly like a P2P connection. The identities that appear in SteamNetConnectionInfo_t will be the FakeIP identity until we know the real identity. Then it will be the real identity. If the

More...
class ISteamNetworkingSockets
bool
BeginAsyncRequestFakeIP
()

Detailed Description

SteamNetConnectionInfo t

:m_addrRemote is valid, it will be a real IPv4 address of a NAT-punched connection. Otherwise, it will not be valid.

To communicate using an ad-hoc sendto/recv from (UDP-style) API, use CreateFakeUDPPort.

Meta