-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (32 loc) · 898 Bytes
/
main.cpp
File metadata and controls
36 lines (32 loc) · 898 Bytes
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
/*********************************************************************************
* File Name : main.cpp
* Created By : QiangWei
* Creation Date : [2015-04-15 13:50]
* Last Modified : [2015-04-15 15:14]
* Description :
**********************************************************************************/
#include "CommandHandler.h"
#include <iostream>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
std::string print()
{
return "haha";
}
std::string print2()
{
return "ahah";
}
std::string print3()
{
return "qw";
}
int main()
{
boost::asio::io_service io;
chl::CommandHandler ch(io, 33334);
ch.bind_command_with_func("haha", boost::bind(&print));
ch.bind_command_with_func("ahah", boost::bind(&print2));
ch.bind_command_with_func("qw", boost::bind(&print3));
io.run();
}