Created
October 29, 2013 18:48
-
-
Save argv0/7220397 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct echo_service | |
{ | |
struct handler : public handler_base | |
{ | |
handler(ip::tcp::socket& socket) : handler_base(socket) {} | |
void handle_data(const std::string& readbuf) | |
{ | |
io::async_write(socket_, buffer(readbuf), ignore()); | |
} | |
}; | |
typedef transport::tcp transport; | |
typedef raw_receiver<handler> protocol; | |
}; | |
typedef server<echo_service> echo_server; | |
int main(void) { | |
std::make_shared<echo_server>("127.0.0.1", "8092")->start(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment