On my computer(Surface Pro 2), there is only one network adapter, it is a wireless LAN adapter.
I worked on a small C++ project, it uses boost::asio to connect to localhost and do its work, everything is just fine.
But today I found that if I disconnect the WLAN from the Internet, this program does not work.
An exception will be thrown by resolver of boost::asio :
tcp::resolver::query query("localhost", "10127");
tcp::resolver resolver(io_service_);
tcp::resolver::iterator iterator;
try {
iterator = resolver.resolve(query);
}
catch (boost::system::system_error& e) {
log(e.what());
}
And the error message was: the requested name is valid but no data of the requested type was found.
Ping to localhost is OK.
I feel puzzled, does a local network program need Internet ? Does a local network program need a LAN adapter ? Why ping works fine ?