Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO async_accept() and c++2011 lambas
From: niXman (i.nixman_at_[hidden])
Date: 2011-07-27 04:03:39


Hi Claude!

Yes, it posible.

acceptor.async_accept(socket,
   [](const boost::system::error_code& e) {
   }
);

niXman.

2011/7/27 Claude <clros_at_[hidden]>

> Hi,
> I found this example for use the async_accept() method:
>
> void accept_handler(const boost::system::error_code& error)
> {
> if (!error)
> {
> // Accept succeeded.
> }
> }
>
> ...
>
> boost::asio::ip::tcp::acceptor acceptor(io_service);
> ...
> boost::asio::ip::tcp::socket socket(io_service);
> acceptor.async_accept(socket, accept_handler);
>
> It is possible use the async_accept with a (c++0x) lambda function instead
> of the function accept_handler()?
>
> --
> View this message in context:
> http://boost.2283326.n4.nabble.com/ASIO-async-accept-and-c-2011-lambas-tp3697807p3697807.html
> Sent from the Boost - Users mailing list archive at Nabble.com.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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