title: How do I convert a host name in to a boost address or endpoint?
body: <p>I'm using a C++ Redis Library on top of Boost. (<a href="https://github.com/nekipelov/redisclient" rel="noreferrer">https://github.com/nekipelov/redisclient</a>)</p>
  
  <p>To connect, I have to give it either a single tcp endpoint:</p>
  
  <pre><code>boost::asio::ip::tcp::endpoint
  </code></pre>
  
  <p>Or an address + port</p>
  
  <pre><code>boost::asio::ip::address, unsigned short
  </code></pre>
  
  <p>Currently, I started with:</p>
  
  <pre><code>boost::asio::ip::address address = boost::asio::ip::address::from_string(someIPVariable);
  </code></pre>
  
  <p>and passed that along with the port, it worked fine and connected. However, I now need to do it by hostname instead of IP. If I simply put the host name in to the line above, it throws an exception as I think it expects an IP address.</p>
  
  <p>I'm used to specifying connections as just <code>("IP OR Hostname", port)</code> so I'm a little unsure what's required here. I checked the constructors for both to see if any could convert a host name + port to what was required, but I can't find anything.</p>