Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost asio question
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2011-02-02 14:49:58


On Thu, Feb 3, 2011 at 3:39 AM, Claude <clros_at_[hidden]> wrote:
>
> Hi, it is possible obtain a Socket (boost::asio::ip::tcp::socket) from an
> acceptor object?
>
> This is my problem:
> I use the accept() method of acceptor for wait on a connection.
>
> But, in java, the method accept() of ServerSocket class return a socket
> object and I can pass this reference to a thread that handles it and I can
> continue to accept() in main program.
>
> It is possible obtain  this behavior with asio?

In Asio, it's the reverse -- you pass it an appropriately constructed
socket to the call to acceptor::accept(...).

Look at the examples for more information on how to do it the
Boost.Asio and C++ way.

The documentation for Boost.Asio is here: http://www.boost.org/libs/asio

PS. The Boost.Asio way is very different from the Java way.

-- 
Dean Michael Berris
about.me/deanberris

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