#include <UDPForwarder.h>
Public Member Functions | |
void | Startup (void) |
void | Shutdown (void) |
Stops the system, and frees all sockets. | |
void | Update (void) |
void | SetMaxForwardEntries (unsigned short maxEntries) |
int | GetMaxForwardEntries (void) const |
int | GetUsedForwardEntries (void) const |
UDPForwarderResult | StartForwarding (SystemAddress source, SystemAddress destination, RakNet::TimeMS timeoutOnNoDataMS, const char *forceHostAddress, unsigned short socketFamily, unsigned short *forwardingPort, SOCKET *forwardingSocket) |
void | StopForwarding (SystemAddress source, SystemAddress destination) |
Public Attributes | |
short | socketFamily |
int RakNet::UDPForwarder::GetMaxForwardEntries | ( | void | ) | const |
int RakNet::UDPForwarder::GetUsedForwardEntries | ( | void | ) | const |
void RakNet::UDPForwarder::SetMaxForwardEntries | ( | unsigned short | maxEntries | ) |
Sets the maximum number of forwarding entries allowed Set according to your available bandwidth and the estimated average bandwidth per forwarded address. A single connection requires 2 entries, as connections are bi-directional.
[in] | maxEntries | The maximum number of simultaneous forwarding entries. Defaults to 64 (32 connections) |
UDPForwarderResult RakNet::UDPForwarder::StartForwarding | ( | SystemAddress | source, | |
SystemAddress | destination, | |||
RakNet::TimeMS | timeoutOnNoDataMS, | |||
const char * | forceHostAddress, | |||
unsigned short | socketFamily, | |||
unsigned short * | forwardingPort, | |||
SOCKET * | forwardingSocket | |||
) |
[out] | forwardingPort | New opened port for forwarding |
[out] | forwardingSocket | New opened socket for forwarding |
void RakNet::UDPForwarder::Startup | ( | void | ) |
Starts the system. Required to call before StartForwarding
void RakNet::UDPForwarder::StopForwarding | ( | SystemAddress | source, | |
SystemAddress | destination | |||
) |
No longer forward datagrams from source to destination
[in] | source | The source IP and port |
[in] | destination | Where to forward to |
void RakNet::UDPForwarder::Update | ( | void | ) |
Call on a regular basis, unless using UDP_FORWARDER_EXECUTE_THREADED. Will call select__() on all sockets and forward messages.
Forwards datagrams from source to destination, and vice-versa Does nothing if this forward entry already exists via a previous call
[in] | source | The source IP and port |
[in] | destination | Where to forward to (and vice-versa) |
[in] | timeoutOnNoDataMS | If no messages are forwarded for this many MS, then automatically remove this entry. Currently hardcoded to UDP_FORWARDER_MAXIMUM_TIMEOUT (else the call fails) |
[in] | forceHostAddress | Force binding on a particular address. 0 to use any. |
[in] | socketFamily | IP version: For IPV4, use AF_INET (default). For IPV6, use AF_INET6. To autoselect, use AF_UNSPEC. |