@@ -86,7 +86,7 @@ class endpoint : public config::socket_type {
8686 // / Type of timer handle
8787 typedef lib::shared_ptr<lib::asio::steady_timer> timer_ptr;
8888 // / Type of a shared pointer to an io_context work object
89- typedef lib::shared_ptr<lib::asio::executor_work_guard<lib::asio::io_context::executor_type>> work_ptr ;
89+ typedef lib::shared_ptr<lib::asio::executor_work_guard<lib::asio::io_context::executor_type>> work_guard_ptr ;
9090
9191 // / Type of socket pre-bind handler
9292 typedef lib::function<lib::error_code(acceptor_ptr)> tcp_pre_bind_handler;
@@ -108,7 +108,7 @@ class endpoint : public config::socket_type {
108108 // Explicitly destroy local objects
109109 m_acceptor.reset ();
110110 m_resolver.reset ();
111- m_work .reset ();
111+ m_work_guard .reset ();
112112 if (m_state != UNINITIALIZED && !m_external_io_context) {
113113 delete m_io_context;
114114 }
@@ -495,8 +495,7 @@ class endpoint : public config::socket_type {
495495 /* *
496496 * Bind the internal acceptor using the given host and service. More details
497497 * about what host and service can be are available in the Asio
498- * documentation for ip::basic_resolver_query::basic_resolver_query's
499- * constructors.
498+ * documentation for the ip::basic_resolver::resolve function.
500499 *
501500 * The endpoint must have been initialized by calling init_asio before
502501 * listening.
@@ -519,14 +518,14 @@ class endpoint : public config::socket_type {
519518 {
520519 using lib::asio::ip::tcp;
521520 tcp::resolver r (*m_io_context);
522- tcp::resolver::results_type endpoints = r.resolve (host, service);
523- if (endpoints .empty ()) {
521+ tcp::resolver::results_type results = r.resolve (host, service);
522+ if (results .empty ()) {
524523 m_elog->write (log::elevel::library,
525524 " asio::listen could not resolve the supplied host or service" );
526525 ec = make_error_code (error::invalid_host_service);
527526 return ;
528527 }
529- listen (*endpoints .begin (),ec);
528+ listen (*(results .begin () ),ec);
530529 }
531530
532531 // / Stop listening (exception free)
@@ -613,8 +612,7 @@ class endpoint : public config::socket_type {
613612 /* *
614613 * Bind the internal acceptor using the given host and service. More
615614 * details about what host and service can be are available in the Asio
616- * documentation for ip::basic_resolver_query::basic_resolver_query's
617- * constructors.
615+ * documentation for the ip::basic_resolver::resolve function.
618616 *
619617 * The endpoint must have been initialized by calling init_asio before
620618 * listening.
@@ -712,7 +710,7 @@ class endpoint : public config::socket_type {
712710 * @since 0.3.0
713711 */
714712 void start_perpetual () {
715- m_work .reset (new lib::asio::executor_work_guard<lib::asio::io_context::executor_type>(m_io_context->get_executor ()));
713+ m_work_guard .reset (new lib::asio::executor_work_guard<lib::asio::io_context::executor_type>(m_io_context->get_executor ()));
716714 }
717715
718716 // / Clears the endpoint's perpetual flag, allowing it to exit when empty
@@ -724,7 +722,7 @@ class endpoint : public config::socket_type {
724722 * @since 0.3.0
725723 */
726724 void stop_perpetual () {
727- m_work .reset ();
725+ m_work_guard .reset ();
728726 }
729727
730728 // / Call back a function after a period of time.
@@ -993,7 +991,7 @@ class endpoint : public config::socket_type {
993991
994992 void handle_resolve (transport_con_ptr tcon, timer_ptr dns_timer,
995993 connect_handler callback, lib::asio::error_code const & ec,
996- lib::asio::ip::tcp::resolver::results_type endpoints )
994+ lib::asio::ip::tcp::resolver::results_type results )
997995 {
998996 if (ec == lib::asio::error::operation_aborted ||
999997 lib::asio::is_neg (dns_timer->expiry () - timer_ptr::element_type::clock_type::now ()))
@@ -1015,7 +1013,7 @@ class endpoint : public config::socket_type {
10151013 s << " Async DNS resolve successful. Results: " ;
10161014
10171015 lib::asio::ip::tcp::resolver::results_type::iterator it;
1018- for (it = endpoints .begin (); it != endpoints .end (); ++it) {
1016+ for (it = results .begin (); it != results .end (); ++it) {
10191017 s << (*it).endpoint () << " " ;
10201018 }
10211019
@@ -1041,7 +1039,7 @@ class endpoint : public config::socket_type {
10411039 if (config::enable_multithreading) {
10421040 lib::asio::async_connect (
10431041 tcon->get_raw_socket (),
1044- endpoints ,
1042+ results ,
10451043 tcon->get_strand ()->wrap (lib::bind (
10461044 &type::handle_connect,
10471045 this ,
@@ -1054,7 +1052,7 @@ class endpoint : public config::socket_type {
10541052 } else {
10551053 lib::asio::async_connect (
10561054 tcon->get_raw_socket (),
1057- endpoints ,
1055+ results ,
10581056 lib::bind (
10591057 &type::handle_connect,
10601058 this ,
@@ -1189,7 +1187,7 @@ class endpoint : public config::socket_type {
11891187 bool m_external_io_context;
11901188 acceptor_ptr m_acceptor;
11911189 resolver_ptr m_resolver;
1192- work_ptr m_work ;
1190+ work_guard_ptr m_work_guard ;
11931191
11941192 // Network constants
11951193 int m_listen_backlog;
0 commit comments