rearranges some stuff

This commit is contained in:
Peter Thorson
2013-01-09 08:05:43 -06:00
parent 43ad5ee342
commit 5d7e32fa10
2 changed files with 6 additions and 3 deletions

View File

@@ -52,12 +52,13 @@ int main() {
// Create a server endpoint
server echo_server;
// Initialize ASIO
echo_server.init_asio();
// Register our message handler
echo_server.set_message_handler(bind(&on_message,&echo_server,::_1,::_2));
echo_server.set_tls_init_handler(bind(&on_tls_init,::_1));
// Initialize ASIO
echo_server.init_asio();
// Listen on port 9002
echo_server.listen(9002);

View File

@@ -99,7 +99,8 @@ public:
if (!con) {
// TODO: should this be considered a server fatal error?
std::cout << "handle_accept got an invalid handle back" << std::endl;
std::cout << "handle_accept got an invalid handle back"
<< std::endl;
} else {
if (ec) {
con->terminate();
@@ -110,6 +111,7 @@ public:
}
}
// TODO: are there cases where we should terminate this loop?
start_accept();
}
private: