33std::vector<GNet::Address> GNet::nameservers(
unsigned int port )
35 std::vector<GNet::Address> result ;
38 FIXED_INFO * info = G::buffer_cast<FIXED_INFO*>( info_buffer ) ;
40 ULONG size =
sizeof(FIXED_INFO) ;
41 auto rc = GetNetworkParams( info , &size ) ;
42 if( rc == ERROR_BUFFER_OVERFLOW )
44 info_buffer.resize( size == ULONG(0) ? std::size_t(1U) :
static_cast<std::size_t
>(size) ) ;
45 info = G::buffer_cast<FIXED_INFO*>( info_buffer ) ;
46 rc = GetNetworkParams( info , &size ) ;
50 const char * p = info->DnsServerList.IpAddress.String ;
54 for(
const IP_ADDR_STRING * addr = info->DnsServerList.Next ; addr ; addr = addr->Next )
56 p = addr->IpAddress.String ;
static bool validStrings(std::string_view ip, std::string_view port_string, std::string *reason=nullptr)
Returns true if the combined network-address string and port string is valid.
static Address parse(std::string_view display_string)
Factory function for any address family.
A substitute for std::vector<char> that has more useful alignment guarantees and explicitly avoids de...