Boost logo

Boost :

Subject: Re: [boost] asio library
From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2009-10-27 04:19:18


On Mon, Oct 26, 2009 at 10:30 PM, Peter Foelsche
<peter_foelsche_at_[hidden]> wrote:
> Out of curiousity (reading somebody comment here regarding socket calls)
> I looked into the asio library and found the following example code below.
> My question is:
> What is the use of the socket object created in the first line?

Doesn't the third line use it?

> I think this line must always be followed by some more code.
> Because of this it does not make sense, that a library exports this
> functionality.
>
> boost::asio::ip::tcp::socket socket(io_service);
> boost::system::error_code ec;
> socket.open(boost::asio::ip::tcp::v4(), ec);
> if (ec)
> {
>  // An error occurred.
> }
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
Olaf

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk