/// handle appelé après acceptation void handle_accept(const boost::system::error_code& e, connection_ptr conn) { if (!e) { // acceptation réussie // lecture des informations conn->async_read(infos, boost::bind(&server::handle_read, this, boost::asio::placeholders::error, conn)); } // démarrage d'une nouvelle connection connection_ptr new_conn(new connection(acceptor_.get_io_service())); acceptor_.async_accept(new_conn->socket(), boost::bind(&server::handle_accept, this, boost::asio::placeholders::error, new_conn)); }
void Server::async_recieve(const boost::system::error_code& e, connection_ptr conn){ conn->async_read(msg_, boost::bind(&Server::handle_read, this, boost::asio::placeholders::error, conn)); }