Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio]: Having trouble getting started with ssl
From: Igor R (boost.lists_at_[hidden])
Date: 2008-12-28 16:28:26


> sslTest.cpp:13: error: invalid initialization of reference of type
> 'boost::asio::basic_stream_socket<boost::asio::ip::tcp,
> boost::asio::stream_socket_service<boost::asio::ip::tcp> >&' from expression
> of type 'boost::asio::basic_socket<boost::asio::ip::tcp,
> boost::asio::stream_socket_service<boost::asio::ip::tcp> >'
>
>
> The message is pretty clear, but I have no idea yet how to fix the problem.
>
<...>
> ip::tcp::socket& sock = sslSock.lowest_layer();

lowest_layer() returns a reference to the base type of
ip::tcp::socket. So you can either declare such a reference:
ssl::stream::lowest_layer_type &sock = ....;
...or (if need some members specific to tcp::socket) static_cast to
the desired type.


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