ReplicaNet and RNLobby
1
|
#include <NATDetectServer.h>
Public Types | |
enum | Reply { kReply_Pending = 0, kReply_Success, kReply_Timeout } |
enum | { kDefaultPort = 4004, kDefaultPortOther = 4005 } |
![]() | |
enum | { kNoOwnerThread = -1 } |
Public Member Functions | |
bool | Start (const XPAddress &address=XPAddress(kDefaultPort), const XPAddress &addressOther=XPAddress(kDefaultPortOther)) |
virtual void | CallbackGotNATDetectProbe (const XPAddress &address) const |
![]() | |
virtual bool | StartWithSocket (t_XPSocket *socket, const bool allowDelete=true) |
virtual bool | Stop (void) |
void | SetEncryptionKey (const void *data, const int length) |
virtual void | CallbackDataReceived (DynamicMessageHelper &message, XPAddress &address) |
virtual void | CallbackDataSend (DynamicMessageHelper &message, XPAddress &address) |
virtual void | CallbackQueryReplyTime (const float seconds) |
virtual bool | CallbackPoll (void) |
![]() | |
ThreadClass () | |
virtual | ~ThreadClass () |
void | Sleep (int milliseconds) |
![]() | |
MutexClass () | |
virtual | ~MutexClass () |
void | Lock (void) |
void | UnLock (void) |
![]() | |
Thread () | |
virtual | ~Thread () |
void | Begin (ThreadClass *threaded_class) |
void | Terminate (void) |
bool | GetTerminated (void) |
bool | GetEverTerminated (void) |
bool | GetIsRunning (void) const |
void | SetPreferredProcessor (int processor=kReplicaNetPreferredProcessorOSChoice) |
int | GetPreferredProcessor (void) |
Additional Inherited Members | |
![]() | |
static SysTimeType | FloatTime (void) |
![]() | |
static int | CallThreadEntry (ThreadClass *thread_class) |
static int | GetCurrentProcessorNumber (void) |
static size_t | GetNumAllocated (void) |
static size_t | GetNumActive (void) |
![]() | |
virtual bool | PackageAndSendData (t_XPSocket *socket, const DynamicMessageHelper &message, const XPAddress &address) |
virtual bool | CallbackParsePacketData (t_XPSocket *socket, const XPAddress &addr, void *data, size_t &length, DynamicMessageHelper &result) |
int | ThreadEntry (void) |
![]() | |
void | DoQuitNow (const int returnCode) |
void | CheckQuit (void) |
![]() | |
static size_t | GetNumAllocated (void) |
![]() | |
t_XPSocket * | mSocket |
bool | mAllowDelete |
int | mNOnce |
A stateless server that responds to query packets with the encoded public IP address of the source. Two instances of this server should be run each on their own separate IP address (in total four IP address:port pairs are used) to allow the NATDetectClient to deduce the NAT type. Assuming a setup with two IP addresses 88.208.234.187 and 88.208.234.188:
A multihomed machine with two or more public IP addresses could use: RLSrvNATDetect.exe /i /s -addr 88.208.234.187:3003 -addr2 88.208.234.187:3004 -addr 88.208.234.188:3003 -addr2 88.208.234.188:3004
A setup with one public IP address for each machine would need to use two machines: RLSrvNATDetect.exe /i /s -addr 88.208.234.187:3003 -addr2 88.208.234.187:3004
RLSrvNATDetect.exe /i /s -addr 88.208.234.188:3003 -addr2 88.208.234.188:3004