# RakNet::UDPProxyServer Class Reference
[UDPProxy]

UDPProxyServer to control our instance of UDPForwarder. More...

`#include <UDPProxyServer.h>`

Inheritance diagram for RakNet::UDPProxyServer:

List of all members.

## Public Member Functions

void | SetResultHandler (UDPProxyServerResultHandler *rh)
bool | LoginToCoordinator (RakNet::RakString password, SystemAddress coordinatorAddress)
virtual void | OnAttach (void)
virtual void | OnDetach (void)
virtual void | Update (void)
| Update is called every time a packet is checked for .
virtual PluginReceiveResult | OnReceive (Packet *packet)
virtual void | OnClosedConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void | OnRakPeerStartup (void)
| Called when RakPeer is initialized.
virtual void | OnRakPeerShutdown (void)
| Called when RakPeer is shutdown.

## Public Attributes

UDPForwarder | udpForwarder

## Detailed Description

UDPProxyServer to control our instance of UDPForwarder.

When NAT Punchthrough fails, it is possible to use a non-NAT system to forward messages from us to the recipient, and vice-versa.
The class to forward messages is UDPForwarder, and it is triggered over the network via the UDPProxyServer plugin.
The UDPProxyServer connects to UDPProxyServer to get a list of servers running UDPProxyServer, and the coordinator will relay our forwarding request.

## Member Function Documentation

bool RakNet::UDPProxyServer::LoginToCoordinator | ( | RakNet::RakString | password,
|  | SystemAddress | coordinatorAddress |
| ) |  |  |

Before the coordinator will register the UDPProxyServer, you must login

Precondition:
  Must be connected to the coordinator

  Coordinator must have set a password with UDPProxyCoordinator::SetRemoteLoginPassword()

Returns:
  false if already logged in, or logging in. Returns true otherwise

virtual void RakNet::UDPProxyServer::OnAttach | ( | void |  | ) | `[virtual]`

Called when the interface is attached

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface2.

virtual void RakNet::UDPProxyServer::OnClosedConnection | ( | SystemAddress | systemAddress,
|  | RakNetGUID | rakNetGUID,
|  | PI2_LostConnectionReason | lostConnectionReason |
| ) |  |  | `[virtual]`

Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system

Parameters:

  `[in]` | systemAddress | The system whose connection was closed
  `[in]` | rakNetGuid | The guid of the specified system
  `[in]` | lostConnectionReason | How the connection was closed: manually, connection lost, or notification of disconnection

Reimplemented from PluginInterface2.

virtual void RakNet::UDPProxyServer::OnDetach | ( | void |  | ) | `[virtual]`

Called when the interface is detached

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface2.

virtual PluginReceiveResult RakNet::UDPProxyServer::OnReceive | ( | Packet * | packet | ) | `[virtual]`

OnReceive is called for every packet.

Parameters:

  `[in]` | packet | the packet that is being returned to the user

Returns:
  True to allow the game and other plugins to get this message, false to absorb it

Reimplemented from PluginInterface2.

void RakNet::UDPProxyServer::SetResultHandler | ( | UDPProxyServerResultHandler * | rh | ) |

Receives the results of calling LoginToCoordinator() Set before calling LoginToCoordinator or you won't know what happened

Parameters:

  `[in]` | resultHandler |

## Member Data Documentation

UDPForwarder RakNet::UDPProxyServer::udpForwarder

Operative class that performs the forwarding Exposed so you can call UDPForwarder::SetMaxForwardEntries() if you want to change away from the default UDPForwarder::Startup(), UDPForwarder::Shutdown(), and UDPForwarder::Update() are called automatically by the plugin

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

- d:/RakNet-3.x/Source/UDPProxyServer.h