Rise
The Vieneo Province
Loading...
Searching...
No Matches
ISteamNetworkingFakeUDPPort Class Referenceabstract

#include <steamnetworkingfakeip.h>

Public Member Functions

virtual void DestroyFakeUDPPort ()=0
virtual EResult SendMessageToFakeIP (const SteamNetworkingIPAddr &remoteAddress, const void *pData, uint32 cbData, int nSendFlags)=0
virtual int ReceiveMessages (SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages)=0
virtual void ScheduleCleanup (const SteamNetworkingIPAddr &remoteAddress)=0

Detailed Description

ISteamNetworkingFakeUDPPort

Acts like a UDP port, sending and receiving datagrams addressed using FakeIP addresses.

See: ISteamNetworkingSockets::CreateFakeUDPPort

Definition at line 29 of file steamnetworkingfakeip.h.

Member Function Documentation

◆ DestroyFakeUDPPort()

virtual void ISteamNetworkingFakeUDPPort::DestroyFakeUDPPort ( )
pure virtual

Destroy the object and cleanup any internal connections. Note that this function call is not threadsafe with respect to any other method of this interface. (However, in general all other operations are threadsafe with respect to each other.)

◆ ReceiveMessages()

virtual int ISteamNetworkingFakeUDPPort::ReceiveMessages ( SteamNetworkingMessage_t ** ppOutMessages,
int nMaxMessages )
pure virtual

Receive messages on the port.

Returns the number of messages returned into your array, up to nMaxMessages.

SteamNetworkingMessage_t::m_identity in the returned message(s) will always contain a FakeIP. See ISteamNetworkingUtils::GetRealIdentityForFakeIP.

◆ ScheduleCleanup()

virtual void ISteamNetworkingFakeUDPPort::ScheduleCleanup ( const SteamNetworkingIPAddr & remoteAddress)
pure virtual

Schedule the internal connection for a given peer to be cleaned up in a few seconds.

Idle connections automatically time out, and so this is not strictly necessary, but if you have reason to believe that you are done talking to a given peer for a while, you can call this to speed up the timeout. If any remaining packets are sent or received from the peer, the cleanup is canceled and the usual timeout value is restored. Thus you will usually call this immediately after sending or receiving application-layer "close connection" packets.

◆ SendMessageToFakeIP()

virtual EResult ISteamNetworkingFakeUDPPort::SendMessageToFakeIP ( const SteamNetworkingIPAddr & remoteAddress,
const void * pData,
uint32 cbData,
int nSendFlags )
pure virtual

Send a datagram to the specified FakeIP.

See ISteamNetworkingSockets::SendMessageToConnection for the meaning of nSendFlags and possible return codes.

Notes:

  • datagrams larger than the underlying MTU are supported, but reliable messages (k_nSteamNetworkingSend_Reliable) are not supported.
  • You will usually want to use k_nSteamNetworkingSend_NoNagle
  • k_EResultBusy is returned if this is a "server" port and the global allocation has not yet completed.
  • k_EResultIPNotFound will be returned if the address is a local/ephemeral address and no existing connection can be found. This can happen if the remote host contacted us without having a global address, and we assigned them a random local address, and then the session with that host timed out.
  • When initiating communications, the first messages may be sent via backend signaling, or otherwise delayed, while a route is found. Expect the ping time to fluctuate during this period, and it's possible that messages will be delivered out of order (which is also possible with ordinary UDP).

The documentation for this class was generated from the following file: