Boost logo

Boost Users :

Subject: Re: [Boost-users] how to share information about a open socket?
From: David Kaplan (davkaplan_at_[hidden])
Date: 2010-03-08 13:28:38


On 8 March 2010 11:32, pedro chaparro <pdro07_at_[hidden]> wrote:

> Hi, based on the example
> http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/tutorial/tutdaytime2.html, i wanna to separate the part of the code that open de connection , and the
> part of the code that write a string over the socket, the problem is , that
> i have no clear how to share the information of the socket between the both
> fuctions. In this code below i suppose that listen fucion must to return the
> socket information, but what data type must the function listen() return???
> thanks so much in advance
>

I use a unique_ptr member, e.g.:

std::unique_ptr<boost::asio::ip::tcp::socket> m_socket



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