Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
RakNet::NatTypeDetectionClient Class Reference

Client code for NatTypeDetection. More...

#include <NatTypeDetectionClient.h>

Inheritance diagram for RakNet::NatTypeDetectionClient:

List of all members.

Public Member Functions

void DetectNATType (SystemAddress _serverAddress)
 NatTypeDetectionClient ()
virtual void OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual PluginReceiveResult OnReceive (Packet *packet)
virtual void Update (void)
 Update is called every time a packet is checked for .
virtual ~NatTypeDetectionClient ()

Static Public Member Functions

static void DestroyInstance (NatTypeDetectionClient *i)
static NatTypeDetectionClientGetInstance (void)

Protected Member Functions

bool IsInProgress (void) const
void OnCompletion (NATTypeDetectionResult result)
void OnTestPortRestricted (Packet *packet)
void Shutdown (void)

Protected Attributes

SOCKET c2
unsigned short c2Port
SystemAddress serverAddress

Detailed Description

See NatTypeDetectionServer.h for algorithm To use, just connect to the server, and call DetectNAT You will get back ID_NAT_TYPE_DETECTION_RESULT with one of the enumerated values of NATTypeDetectionResult found in NATTypeDetectionCommon.h See also http://www.jenkinssoftware.com/raknet/manual/natpunchthrough.html

See also:
NatPunchthroughClient
NatTypeDetectionServer

Definition at line 37 of file NatTypeDetectionClient.h.


Constructor & Destructor Documentation

RakNet::NatTypeDetectionClient::NatTypeDetectionClient ( )
virtual RakNet::NatTypeDetectionClient::~NatTypeDetectionClient ( ) [virtual]

Member Function Documentation

static void RakNet::NatTypeDetectionClient::DestroyInstance ( NatTypeDetectionClient i) [static]
void RakNet::NatTypeDetectionClient::DetectNATType ( SystemAddress  _serverAddress)

Send the message to the server to detect the nat type Server must be running NatTypeDetectionServer We must already be connected to the server

Parameters:
[in]serverAddressaddress of the server
static NatTypeDetectionClient* RakNet::NatTypeDetectionClient::GetInstance ( void  ) [static]
bool RakNet::NatTypeDetectionClient::IsInProgress ( void  ) const [protected]
virtual void RakNet::NatTypeDetectionClient::OnClosedConnection ( const 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]systemAddressThe system whose connection was closed
[in]rakNetGuidThe guid of the specified system
[in]lostConnectionReasonHow the connection was closed: manually, connection lost, or notification of disconnection

Reimplemented from RakNet::PluginInterface2.

void RakNet::NatTypeDetectionClient::OnCompletion ( NATTypeDetectionResult  result) [protected]
virtual PluginReceiveResult RakNet::NatTypeDetectionClient::OnReceive ( Packet packet) [virtual]

OnReceive is called for every packet.

Parameters:
[in]packetthe 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 RakNet::PluginInterface2.

void RakNet::NatTypeDetectionClient::OnTestPortRestricted ( Packet packet) [protected]
void RakNet::NatTypeDetectionClient::Shutdown ( void  ) [protected]
virtual void RakNet::NatTypeDetectionClient::Update ( void  ) [virtual]

Reimplemented from RakNet::PluginInterface2.


Member Data Documentation

Definition at line 65 of file NatTypeDetectionClient.h.

unsigned short RakNet::NatTypeDetectionClient::c2Port [protected]

Definition at line 66 of file NatTypeDetectionClient.h.

Definition at line 72 of file NatTypeDetectionClient.h.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net