2013-06-05 19:19:00 +00:00
|
|
|
#include <fc/asio.hpp>
|
|
|
|
|
#include <fc/network/ip.hpp>
|
|
|
|
|
|
|
|
|
|
namespace fc
|
|
|
|
|
{
|
2013-06-27 18:19:08 +00:00
|
|
|
std::vector<fc::ip::endpoint> resolve( const fc::string& host, uint16_t port )
|
2013-06-05 19:19:00 +00:00
|
|
|
{
|
|
|
|
|
auto ep = fc::asio::tcp::resolve( host, std::to_string(uint64_t(port)) );
|
2013-06-27 18:19:08 +00:00
|
|
|
std::vector<fc::ip::endpoint> eps;
|
2013-06-05 19:19:00 +00:00
|
|
|
eps.reserve(ep.size());
|
|
|
|
|
for( auto itr = ep.begin(); itr != ep.end(); ++itr )
|
|
|
|
|
eps.push_back( fc::ip::endpoint(itr->address().to_v4().to_ulong(), itr->port()) );
|
|
|
|
|
return eps;
|
|
|
|
|
}
|
|
|
|
|
}
|