Client code for NATPunchthrough. More...
#include <NatPunchthroughClient.h>
Inherits PluginInterface2.
Client code for NATPunchthrough.
Maintain connection to NatPunchthroughServer to process incoming connection attempts through NatPunchthroughClient
Client will send datagrams to port to estimate next port
Will simultaneously connect with another client once ports are estimated.
Definition at line 120 of file NatPunchthroughClient.h.
NatPunchthroughClient::NatPunchthroughClient | ( | ) |
Definition at line 25 of file NatPunchthroughClient.cpp.
NatPunchthroughClient::~NatPunchthroughClient | ( | ) |
void NatPunchthroughClient::Clear | ( | void | ) |
Definition at line 703 of file NatPunchthroughClient.cpp.
unsigned int NatPunchthroughClient::GetPendingOpenNATIndex | ( | RakNetGUID | destination, | |
SystemAddress | facilitator | |||
) | [protected] |
PunchthroughConfiguration * NatPunchthroughClient::GetPunchthroughConfiguration | ( | void | ) |
Modify the system configuration if desired Don't modify the variables in the structure while punchthrough is in progress
Definition at line 709 of file NatPunchthroughClient.cpp.
unsigned short NatPunchthroughClient::GetUPNPExternalPort | ( | void | ) | const |
Returns the port on the router that incoming messages will be sent to UPNP needs to know this (See UPNP project)
Definition at line 52 of file NatPunchthroughClient.cpp.
RakNet::RakString NatPunchthroughClient::GetUPNPInternalAddress | ( | void | ) | const |
Returns our locally bound system address Equivalent to calling rakPeer->GetInternalID(UNASSIGNED_SYSTEM_ADDRESS).ToString(false);
Definition at line 60 of file NatPunchthroughClient.cpp.
unsigned short NatPunchthroughClient::GetUPNPInternalPort | ( | void | ) | const |
Returns our internal port that RakNet was started on Equivalent to calling rakPeer->GetInternalID(UNASSIGNED_SYSTEM_ADDRESS).port
Definition at line 56 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnAttach | ( | void | ) | [virtual] |
Called when the interface is attached
[in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface2.
Definition at line 691 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::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
[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.
Definition at line 583 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnConnectAtTime | ( | Packet * | packet | ) | [protected] |
Definition at line 501 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnDetach | ( | void | ) | [virtual] |
Called when the interface is detached
[in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface2.
Definition at line 695 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnGetMostRecentPort | ( | Packet * | packet | ) | [protected] |
Definition at line 649 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnNewConnection | ( | SystemAddress | systemAddress, | |
RakNetGUID | rakNetGUID, | |||
bool | isIncoming | |||
) | [virtual] |
Called when we got a new connection
[in] | systemAddress | Address of the new connection |
[in] | rakNetGuid | The guid of the specified system |
[in] | isIncoming | If true, this is ID_NEW_INCOMING_CONNECTION, or the equivalent |
Reimplemented from PluginInterface2.
Definition at line 572 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnPunchthroughFailure | ( | void | ) | [protected] |
Definition at line 216 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnRakPeerShutdown | ( | void | ) | [virtual] |
Called when RakPeer is shutdown.
Reimplemented from PluginInterface2.
Definition at line 699 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::OnReadyForNextPunchthrough | ( | void | ) | [protected] |
Definition at line 713 of file NatPunchthroughClient.cpp.
PluginReceiveResult NatPunchthroughClient::OnReceive | ( | Packet * | packet | ) | [virtual] |
OnReceive is called for every packet.
[in] | packet | the packet that is being returned to the user |
Reimplemented from PluginInterface2.
Definition at line 296 of file NatPunchthroughClient.cpp.
bool NatPunchthroughClient::OpenNAT | ( | RakNetGUID | destination, | |
SystemAddress | facilitator | |||
) |
Punchthrough a NAT. Doesn't connect, just tries to setup the routing table.
Definition at line 36 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::PushFailure | ( | void | ) | [protected] |
Definition at line 203 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::PushSuccess | ( | void | ) | [protected] |
Definition at line 725 of file NatPunchthroughClient.cpp.
bool NatPunchthroughClient::RemoveFromFailureQueue | ( | void | ) | [protected] |
Definition at line 741 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::SendOutOfBand | ( | SystemAddress | sa, | |
MessageID | oobId | |||
) | [protected] |
Definition at line 541 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::SendPunchthrough | ( | RakNetGUID | destination, | |
SystemAddress | facilitator | |||
) | [protected] |
Definition at line 675 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::SendTTL | ( | SystemAddress | sa | ) | [protected] |
void NatPunchthroughClient::SetDebugInterface | ( | NatPunchthroughDebugInterface * | i | ) |
Sets a callback to be called with debug messages
[in] | i | Pointer to an interface. The pointer is stored, so don't delete it while in progress. Pass 0 to clear. |
Definition at line 48 of file NatPunchthroughClient.cpp.
void NatPunchthroughClient::Update | ( | void | ) | [virtual] |
Update is called every time a packet is checked for .
Reimplemented from PluginInterface2.
Definition at line 67 of file NatPunchthroughClient.cpp.
Definition at line 233 of file NatPunchthroughClient.h.
unsigned short NatPunchthroughClient::mostRecentNewExternalPort [protected] |
Definition at line 171 of file NatPunchthroughClient.h.
Definition at line 224 of file NatPunchthroughClient.h.
PunchthroughConfiguration NatPunchthroughClient::pc [protected] |
Definition at line 223 of file NatPunchthroughClient.h.
struct NatPunchthroughClient::SendPing NatPunchthroughClient::sp [protected] |