std::string CPosixConnection::GetNameServer() const { std::string nameserver("127.0.0.1"); #if defined(TARGET_ANDROID) char ns[PROP_VALUE_MAX]; if (__system_property_get("net.dns1", ns)) nameserver = ns; #else res_init(); for (int i = 0; i < _res.nscount; i ++) { nameserver = inet_ntoa(((struct sockaddr_in *)&_res.nsaddr_list[0])->sin_addr); break; } #endif return nameserver; }
std::string CPosixConnection::GetNameServer() const { std::string nameserver("127.0.0.1"); return nameserver; }