NATDetectServer.h

00001 /* START_LICENSE_HEADER
00002 
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001 Replica Software
00005 
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009 
00010 END_LICENSE_HEADER */
00011 #ifndef _NATDETECTSERVER_H_
00012 #define _NATDETECTSERVER_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include "RNLobby/Inc/BaseServer.h"
00015 
00016 namespace RNReplicaNet
00017 {
00018 
00019 namespace RNLobby
00020 {
00021 
00027 class NATDetectServer : public BaseServer
00028 {
00029 public:
00030     NATDetectServer();
00031     virtual ~NATDetectServer();
00032 
00033     enum Reply
00034     {
00035         kReply_Pending = 0,
00036         kReply_Success,
00037         kReply_Timeout
00038     };
00039     enum
00040     {
00041         kDefaultPort = 3003,
00042         kDefaultPortOther = 3004
00043     };
00044 
00045     bool Start(const XPAddress &address = XPAddress(kDefaultPort),const XPAddress &addressOther = XPAddress(kDefaultPortOther));
00046 
00047     virtual void CallbackGotNATDetectProbe(const XPAddress &address) const {};
00048 
00049 private:
00050     bool CallbackParseValidMessage(DynamicMessageHelper &message,const size_t length,const XPAddress &address);
00051 
00052     void CallbackTidy(void);
00053 
00054     t_XPSocket *mOtherSocket;
00055 };
00056 
00057 } // namespace RNLobby
00058 
00059 } // namespace RNReplicaNet
00060 
00061 #endif

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