zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
6.98k stars 1.97k forks source link

handle_socket_init, uninitialized socket for tls #709

Open JulianSchutsch opened 6 years ago

JulianSchutsch commented 6 years ago

Websocketpp Version: Current development branch, head. When using the websocketpp::config::asio_tls_client and handle_socket_init with something like:

void T::handle_socket_init(Connection, boost::asio::ssl::stream& socket) { boost::asio::ip::tcp::no_delay n(true); socket.lowest_layer().set_option(n); }

This gives:

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector >' what(): set_option: Bad file descriptor Aborted (core dumped)

Am I misreading the documentation? It seems the only way to initialize this option is to store the socket pointer somewhere and do this in the connect callback (which works, tested).

urp commented 5 years ago

Seems to be related to #530

JulianSchutsch commented 5 years ago

It is, i follow the other thread.