-
Notifications
You must be signed in to change notification settings - Fork 0
/
connection.h
51 lines (36 loc) · 1001 Bytes
/
connection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* connection.h
*
* Created on: 2013Äê8ÔÂ22ÈÕ
* Author: 1854
*/
#ifndef CONNECTION_H_
#define CONNECTION_H_
#include "server_namespace.h"
#include "common/common_objectpool.h"
#include "frame_outsidesocket.h"
#include <string>
using namespace std;
FRAME_ROBOT_NAMESPACE_BEGIN
class CPlayer;
typedef int32_t (CPlayer::*connectsuccess)(void);
typedef int32_t (CPlayer::*connecttimeout)(void);
class CConnection : public COutsideSocket
{
public:
CConnection();
virtual ~CConnection();
virtual int32_t OnConnected();
virtual int32_t OnConnectTimeout();
void SetConnectSuccessCallback(CPlayer *pPlayer, connectsuccess proc);
void SetConnectTimeoutCallback(CPlayer *pPlayer, connecttimeout proc);
CPlayer *GetPlayerObj();
protected:
int32_t MakeMessage();
protected:
CPlayer *m_pPlayer;
connectsuccess m_pConnectSucccess;
connecttimeout m_pConnectTimeout;
};
FRAME_ROBOT_NAMESPACE_END
#endif /* CONNECTION_H_ */