Added Client::close, and Client::connections and Client::connections_mutex are no longer shared_ptrs
This commit is contained in:
parent
16aa958903
commit
d9416c2566
4 changed files with 42 additions and 42 deletions
|
|
@ -55,16 +55,12 @@ namespace SimpleWeb {
|
|||
asio::ssl::context context;
|
||||
|
||||
void accept() override {
|
||||
//Create new socket for this connection
|
||||
//Shared_ptr is used to pass temporary objects to the asynchronous functions
|
||||
auto session = std::make_shared<Session>(this->shared_from_this(), std::make_shared<HTTPS>(*io_service, context));
|
||||
|
||||
acceptor->async_accept(session->socket->lowest_layer(), [this, session](const error_code &ec) {
|
||||
//Immediately start accepting a new connection (if io_service hasn't been stopped)
|
||||
if(ec != asio::error::operation_aborted)
|
||||
this->accept();
|
||||
|
||||
|
||||
if(!ec) {
|
||||
asio::ip::tcp::no_delay option(true);
|
||||
session->socket->lowest_layer().set_option(option);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue