
24 Mar
2010
24 Mar
'10
4:33 p.m.
On 23.3.2010 13:55, Marcel Fransen wrote:
I would like to create an ssl stream for an already accepted native socket, just like is possible with basic_stream_socket<tcp>. How should this be done?
If you already have a tcp::socket you can specify your ssl stream to use a reference to tcp socket as its first template parameter: ssl::stream<ip::tcp::socket &> ssl_stream( existing_socket, ... ); Of course, you need to insure that 'ssl_stream' does not outlive 'existing_socket'. HTH