[Boost-bugs] [Boost C++ Libraries] #8590: ip::basic_resolver_query should accept numeric port numbers

Subject: [Boost-bugs] [Boost C++ Libraries] #8590: ip::basic_resolver_query should accept numeric port numbers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-19 01:57:47


#8590: ip::basic_resolver_query should accept numeric port numbers
--------------------------------------------------+-------------------------
 Reporter: Adam Nielsen <a.nielsen@…> | Owner: chris_kohlhoff
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.52.0 | Severity: Optimization
 Keywords: |
--------------------------------------------------+-------------------------
 If you have a numeric port number (such as in my case, the response from
 an FTP server's PASV command), you have to convert it to a string before
 passing it to ip::basic_resolver_query. This seems inefficient, so it
 would be nice if an overload could be added which would take an unsigned
 short port number, and assume
 boost::asio::ip::resolver_query_base::numeric_service has been specified.

 Currently, it must be done like this:

 {{{
 unsigned short port = 12345;
 std::stringstream ss;
 ss << port;
 boost::asio::ip::tcp::resolver::query query(host, ss.str(),
 boost::asio::ip::resolver_query_base::numeric_service);
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8590>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC