specialunderwear/websocketpp — comment on commit 77a2208501cb88957d9fa4483d33c00b0435cd7a
File:  line 0
By specialunderwear:

Yeah I know, but handlers don't have a reference to the connection. Instead of finding out in which order the handlers are executed, and storing a ref up to the point where on_tls_init is called, it is clearer to provide the handler with what it needs. Same as the other handlers are set up. Ofc you could modify the signature and pass the connection, like the other handlers. But you don't need a connection to set up an ssl context, you need the io_service, so this is more direct!

Lars van de Kerkhof
lars@permanentmarkers.nl
tel 06-24352007

On 31 jan. 2012, at 12:34, megabyte1024 wrote:

> Do you need access to the io_service inside of on_tls_init? If no, then every connection has a reference to the io_service, for instance,
>

void CTestHandler::on_open(connection_ptr connection) {
> if (connection != nullptr) {
> boost::asio::io_service &service = connection->get_io_service();
> }
> }

>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/specialunderwear/websocketpp/commit/77a2208501cb88957d9fa4483d33c00b0435cd7a#commitcomment-917903