forked from boostorg/beast
		
	Examples use bind_front_handler
This commit is contained in:
		@@ -248,11 +248,9 @@ class session : public std::enable_shared_from_this<session>
 | 
			
		||||
            http::async_write(
 | 
			
		||||
                self_.stream_,
 | 
			
		||||
                *sp,
 | 
			
		||||
                std::bind(
 | 
			
		||||
                beast::bind_front_handler(
 | 
			
		||||
                    &session::on_write,
 | 
			
		||||
                    self_.shared_from_this(),
 | 
			
		||||
                    std::placeholders::_1,
 | 
			
		||||
                    std::placeholders::_2,
 | 
			
		||||
                    sp->need_eof()));
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
@@ -287,10 +285,9 @@ public:
 | 
			
		||||
        // Perform the SSL handshake
 | 
			
		||||
        stream_.async_handshake(
 | 
			
		||||
            ssl::stream_base::server,
 | 
			
		||||
            std::bind(
 | 
			
		||||
            beast::bind_front_handler(
 | 
			
		||||
                &session::on_handshake,
 | 
			
		||||
                shared_from_this(),
 | 
			
		||||
                std::placeholders::_1));
 | 
			
		||||
                shared_from_this()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
@@ -314,11 +311,9 @@ public:
 | 
			
		||||
 | 
			
		||||
        // Read a request
 | 
			
		||||
        http::async_read(stream_, buffer_, req_,
 | 
			
		||||
            std::bind(
 | 
			
		||||
            beast::bind_front_handler(
 | 
			
		||||
                &session::on_read,
 | 
			
		||||
                shared_from_this(),
 | 
			
		||||
                std::placeholders::_1,
 | 
			
		||||
                std::placeholders::_2));
 | 
			
		||||
                shared_from_this()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
@@ -341,9 +336,9 @@ public:
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
    on_write(
 | 
			
		||||
        bool close,
 | 
			
		||||
        beast::error_code ec,
 | 
			
		||||
        std::size_t bytes_transferred,
 | 
			
		||||
        bool close)
 | 
			
		||||
        std::size_t bytes_transferred)
 | 
			
		||||
    {
 | 
			
		||||
        boost::ignore_unused(bytes_transferred);
 | 
			
		||||
 | 
			
		||||
@@ -372,10 +367,9 @@ public:
 | 
			
		||||
 | 
			
		||||
        // Perform the SSL shutdown
 | 
			
		||||
        stream_.async_shutdown(
 | 
			
		||||
            std::bind(
 | 
			
		||||
            beast::bind_front_handler(
 | 
			
		||||
                &session::on_shutdown,
 | 
			
		||||
                shared_from_this(),
 | 
			
		||||
                std::placeholders::_1));
 | 
			
		||||
                shared_from_this()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
@@ -456,11 +450,9 @@ public:
 | 
			
		||||
    do_accept()
 | 
			
		||||
    {
 | 
			
		||||
        acceptor_.async_accept(
 | 
			
		||||
            std::bind(
 | 
			
		||||
            beast::bind_front_handler(
 | 
			
		||||
                &listener::on_accept,
 | 
			
		||||
                shared_from_this(),
 | 
			
		||||
                std::placeholders::_1,
 | 
			
		||||
                std::placeholders::_2));
 | 
			
		||||
                shared_from_this()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user