Can now use external, or reuse, boost::asio::io_service.
This commit is contained in:
parent
e50f0b597f
commit
3a4b7143cc
2 changed files with 27 additions and 18 deletions
|
|
@ -28,9 +28,9 @@ namespace SimpleWeb {
|
|||
void accept() {
|
||||
//Create new socket for this connection
|
||||
//Shared_ptr is used to pass temporary objects to the asynchronous functions
|
||||
std::shared_ptr<HTTPS> socket(new HTTPS(io_service, context));
|
||||
std::shared_ptr<HTTPS> socket(new HTTPS(*io_service, context));
|
||||
|
||||
acceptor.async_accept((*socket).lowest_layer(), [this, socket](const boost::system::error_code& ec) {
|
||||
acceptor->async_accept((*socket).lowest_layer(), [this, socket](const boost::system::error_code& ec) {
|
||||
//Immediately start accepting a new connection
|
||||
accept();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue