forked from jimingmin/frame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame_listenentry.h
80 lines (64 loc) · 1.27 KB
/
frame_listenentry.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* frame_listenentry.h
*
* Created on: May 12, 2015
* Author: jimm
*/
#ifndef FRAME_LISTENENTRY_H_
#define FRAME_LISTENENTRY_H_
#include "common/common_object.h"
#include "netevent/net_impl.h"
#include "frame_namespace.h"
using namespace NETEVENT;
FRAME_NAMESPACE_BEGIN
class CFrameListenEntry : public CBaseObject
{
public:
CFrameListenEntry(const char *szAddr, uint16_t nPort, IPacketParserFactory *pParserFactory, IIOHandler *pIOHandler)
{
memset(m_szListenAddr, 0, sizeof(m_szListenAddr));
if(szAddr != NULL)
{
strcpy(m_szListenAddr, szAddr);
}
m_nListenPort = nPort;
m_pParserFactory = pParserFactory;
m_pIOHandler = pIOHandler;
}
virtual ~CFrameListenEntry(){}
virtual int32_t Init()
{
return 0;
}
virtual int32_t Uninit()
{
return 0;
}
virtual int32_t GetSize()
{
return 0;
}
const char *GetListenAddr()
{
return m_szListenAddr;
}
uint16_t GetListenPort()
{
return m_nListenPort;
}
IPacketParserFactory *GetPacketParserFactory()
{
return m_pParserFactory;
}
IIOHandler *GetIOHandler()
{
return m_pIOHandler;
}
protected:
char m_szListenAddr[64];
uint16_t m_nListenPort;
IPacketParserFactory *m_pParserFactory;
IIOHandler *m_pIOHandler;
};
FRAME_NAMESPACE_END
#endif /* FRAME_LISTENENTRY_H_ */