GameServer
CacheServerConnection.h
[詳解]
1 
6 #ifndef __CACHESERVERCONNECTION_H__
7 #define __CACHESERVERCONNECTION_H__
8 
9 #include "TCPConnection.h"
10 
11 class PacketBase;
12 
18 class CacheServerConnection : public TCPConnection, public noncopyable
19 {
20 
21 public:
22 
26  CacheServerConnection(const shared_ptr<tcp::socket> &pInSocket);
27 
32 
38  bool Connect();
39 
45  void SendPacket(PacketBase *pPacket);
46 
47 protected:
48 
54  virtual void OnRecvData(size_t Size);
55 
60  virtual void OnDisconnected();
61 
62 private:
63 
64  // ============ Singletonもどき ================
65 
66 public:
67 
73  static CacheServerConnection *GetInstance() { return pInstance; }
74 
75 private:
76 
77  static CacheServerConnection *pInstance;
78 
79 };
80 
81 #endif // #ifndef __CACHESERVERCONNECTION_H__
bool Connect()
接続
Definition: CacheServerConnection.cpp:27
キャッシュサーバとの接続.
Definition: CacheServerConnection.h:18
virtual void OnDisconnected()
切断された
Definition: CacheServerConnection.cpp:86
CacheServerConnection(const shared_ptr< tcp::socket > &pInSocket)
コンストラクタ
Definition: CacheServerConnection.cpp:20
void SendPacket(PacketBase *pPacket)
パケット送信
Definition: CacheServerConnection.cpp:45
Definition: TCPConnection.h:9
virtual ~CacheServerConnection()
デストラクタ
Definition: CacheServerConnection.h:31
Definition: PacketBase.h:9
virtual void OnRecvData(size_t Size)
データを受信した
Definition: CacheServerConnection.cpp:66
static CacheServerConnection * GetInstance()
インスタンス取得
Definition: CacheServerConnection.h:73