Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

NatPunchthroughServer Class Reference
[NatPunchthrough]

Server code for NATPunchthrough. More...

#include <NatPunchthroughServer.h>

Inherits PluginInterface2.

Collaboration diagram for NatPunchthroughServer:
Collaboration graph
[legend]

List of all members.

Classes

struct  ConnectionAttempt
struct  User

Public Member Functions

 NatPunchthroughServer ()
virtual ~NatPunchthroughServer ()
void SetDebugInterface (NatPunchthroughServerDebugInterface *i)
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 OnNewConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, bool isIncoming)

Static Public Member Functions

static int NatPunchthroughUserComp (const RakNetGUID &key, User *const &data)

Public Attributes

RakNetTime lastUpdate

Protected Member Functions

void OnNATPunchthroughRequest (Packet *packet)
void OnGetMostRecentPort (Packet *packet)
void OnClientReady (Packet *packet)
void SendTimestamps (void)
void StartPendingPunchthrough (void)
void StartPunchthroughForUser (User *user)

Protected Attributes

DataStructures::OrderedList
< RakNetGUID, User
*, NatPunchthroughServer::NatPunchthroughUserComp > 
users
uint16_t sessionId
NatPunchthroughServerDebugInterfacenatPunchthroughServerDebugInterface

Detailed Description

Server code for NATPunchthrough.

Maintain connection to NatPunchthroughServer to process incoming connection attempts through NatPunchthroughClient
Server maintains two sockets clients can connect to so as to estimate the next port choice
Server tells other client about port estimate, current public port to the server, and a time to start connection attempts

See also:
NatTypeDetectionClient See also http://www.jenkinssoftware.com/raknet/manual/natpunchthrough.html

Definition at line 67 of file NatPunchthroughServer.h.


Constructor & Destructor Documentation

NatPunchthroughServer::NatPunchthroughServer (  ) 

Definition at line 103 of file NatPunchthroughServer.cpp.

NatPunchthroughServer::~NatPunchthroughServer (  )  [virtual]

Definition at line 109 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:


Member Function Documentation

int NatPunchthroughServer::NatPunchthroughUserComp ( const RakNetGUID key,
User *const &  data 
) [static]

Definition at line 94 of file NatPunchthroughServer.cpp.

void NatPunchthroughServer::OnClientReady ( Packet packet  )  [protected]

Definition at line 332 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void NatPunchthroughServer::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.

Definition at line 223 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

void NatPunchthroughServer::OnGetMostRecentPort ( Packet packet  )  [protected]

Definition at line 344 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void NatPunchthroughServer::OnNATPunchthroughRequest ( Packet packet  )  [protected]

Definition at line 292 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void NatPunchthroughServer::OnNewConnection ( SystemAddress  systemAddress,
RakNetGUID  rakNetGUID,
bool  isIncoming 
) [virtual]

Called when we got a new connection

Parameters:
[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 280 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

PluginReceiveResult NatPunchthroughServer::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.

Definition at line 207 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

void NatPunchthroughServer::SendTimestamps ( void   )  [protected]
void NatPunchthroughServer::SetDebugInterface ( NatPunchthroughServerDebugInterface i  ) 

Sets a callback to be called with debug messages

Parameters:
[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 131 of file NatPunchthroughServer.cpp.

void NatPunchthroughServer::StartPendingPunchthrough ( void   )  [protected]
void NatPunchthroughServer::StartPunchthroughForUser ( User user  )  [protected]

Definition at line 478 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void NatPunchthroughServer::Update ( void   )  [virtual]

Update is called every time a packet is checked for .

Reimplemented from PluginInterface2.

Definition at line 135 of file NatPunchthroughServer.cpp.

Here is the call graph for this function:


Member Data Documentation

Definition at line 117 of file NatPunchthroughServer.h.

Definition at line 130 of file NatPunchthroughServer.h.

Definition at line 129 of file NatPunchthroughServer.h.

DataStructures::OrderedList<RakNetGUID, User*, NatPunchthroughServer::NatPunchthroughUserComp> NatPunchthroughServer::users [protected]

Definition at line 121 of file NatPunchthroughServer.h.


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