lichao
2021-05-27 026bbfaf2b5d73a26b8e2fa49158883ef64c211b
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
/*
 * =====================================================================================
 *
 *       Filename:  tcp_server.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2021年05月19日 15时06分01秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Li Chao (), lichao@aiotlink.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef TCP_SERVER_795VXR94
#define TCP_SERVER_795VXR94
 
#include "bh_util.h"
#include "io_service.h"
#include "tcp_common.h"
 
class NodeCenter;
class TcpServer : public IoService
{
public:
    typedef std::shared_ptr<Synced<NodeCenter>> CenterPtr;
    TcpServer(int port, CenterPtr pscenter);
    ~TcpServer();
 
private:
    virtual void OnStop();
    void Accept();
    tcp::acceptor listener_;
    CenterPtr pscenter_;
};
 
#endif // end of include guard: TCP_SERVER_795VXR94