|
Boost Users : |
Subject: Re: [Boost-users] Passing * to member function as parameter
From: Igor R (boost.lists_at_[hidden])
Date: 2010-04-20 08:29:55
> How would I pass a pointer to a member function from the read request to the write handler to call when it performs the write.
> void handle_read_banner(
> Â const boost::system::error_code& error,
> Â Â Â std::size_t bytes_transferred
> ) {
> Â if(!error) {
> Â Â Â Â Â response_.consume(bytes_transferred);
> Â Â Â Â Â Â Â boost::asio::async_write(socket_, request_,
> Â Â Â Â Â Â Â Â Â boost::bind(&asterisk::handle_write_request, this,
> Â Â Â Â Â Â Â Â Â Â Â boost::asio::placeholders::error
> Â Â Â //, * to next read handler...
> Â Â Â ));
> Â Â Â }else{
> Â Â Â Â Â throw(boost::system::system_error(error));
> Â Â Â }
> }
>
> void handle_write_request(
> Â const boost::system::error_code& error
> Â //, memfunction func
> ) {
> Â if (!error) {
> Â Â Â boost::asio::async_read_until(socket_, response_, "\r\n",
> Â Â Â Â Â Â Â Â Â boost::bind(
> Â Â Â Â Â //&asterisk::handle_read_login_attempt,
> Â Â Â Â Â func
> Â Â Â Â Â this,
> Â Â Â Â Â Â Â Â Â Â Â boost::asio::placeholders::error,
> Â Â Â Â Â Â Â Â Â Â Â boost::asio::placeholders::bytes_transferred));
> Â Â Â }else{
> Â Â Â throw(boost::system::system_error(error));
> Â Â Â }
> }
Could you mention what line doesn't compile and error you get?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net