NATDetectClient Class Reference

#include <NATDetectClient.h>

Inheritance diagram for NATDetectClient:

Inheritance graph
[legend]
Collaboration diagram for NATDetectClient:

Collaboration graph
[legend]

List of all members.

Public Types

enum  NATType { kOpen = 0, kModerate, kStrict }

Public Member Functions

bool Start (const int channel=TransportAnyGameChannel)
void SetServers (const XPAddress &address1, const XPAddress &address2)
 Sets the address and port of the servers. The default for the instance of the class is localhost and port NATDetectServer::kDefaultPort and NATDetectServer::kDefaultPort+1.
bool GetCompleted (void)
NATDetectServer::Reply GetReply (void)
NATType GetNATType (void) const
 If GetReply() == NATDetectServer::kReply_Success this returns the type of NAT calculated by this class.
XPAddress GetPublicAddress (void) const
 Returns the public internet address of this computer as seen by the NATDetectServer.
virtual void CallbackCompleted (void)
 A virtual callback that is triggered when the NASTDetect calculation is complete. GetReply(), GetNATType() and GetPublicAddress() can be used during this callback or at any time after completion.


Detailed Description

This class interrogates the network connection of a machine to determine the if there is any NAT implemented to known external machines.

Member Function Documentation

bool Start ( const int  channel = TransportAnyGameChannel  ) 

If using a specific game channel for ReplicaNet/XPSession then remember to stop the NATDetectClient service before calling ReplicaNet::SessionCreate()/XPSessionCreate() so the game channel is free for ReplicaNet/XPSession to use.

bool GetCompleted ( void   ) 

Tests the completion state of the last query. When the query completes the result can be retrieved by using GetReply()

Returns:
A completed query returns true, a pending query returns false.

NATDetectServer::Reply GetReply ( void   ) 

Returns the last reply from a completed query.

Returns:
The last reply from a completed query.


Generated on Sat Jun 28 22:02:33 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3