diff --git a/lib/asio_client_session.cc b/lib/asio_client_session.cc index 5cf01c7..81a4ab3 100644 --- a/lib/asio_client_session.cc +++ b/lib/asio_client_session.cc @@ -44,6 +44,17 @@ session::session(boost::asio::io_service &io_service, const std::string &host, impl_->start_resolve(host, service); } +session::session(boost::asio::io_service &io_service, const std::string &host, + const std::string &service, + connect_cb ccb, + error_cb ecb) + : impl_(std::make_shared( + io_service, host, service, boost::posix_time::seconds(60))) { + impl_->on_connect(std::move(ccb)); + impl_->on_error(std::move(ecb)); + impl_->start_resolve(host, service); +} + session::session(boost::asio::io_service &io_service, const boost::asio::ip::tcp::endpoint &local_endpoint, const std::string &host, const std::string &service) diff --git a/lib/includes/nghttp2/asio_http2_client.h b/lib/includes/nghttp2/asio_http2_client.h index 7257914..89cfea5 100644 --- a/lib/includes/nghttp2/asio_http2_client.h +++ b/lib/includes/nghttp2/asio_http2_client.h @@ -150,6 +150,11 @@ class session { session(boost::asio::io_service &io_service, const std::string &host, const std::string &service); + session(boost::asio::io_service &io_service, const std::string &host, + const std::string &service, + connect_cb ccb, + error_cb ecb); + // Same as previous but with pegged local endpoint session(boost::asio::io_service &io_service, const boost::asio::ip::tcp::endpoint &local_endpoint,