[Boost.Asio] Is there a way to find out first address of first NIC in the local host using Asio?

21 Oct
21 Oct
9:39 a.m.
New subject: [Boost.Asio] Is there a way to find out first address of first NIC in the local host using Asio?
I'm not sure it is the *first* address of the *first* nic (depends of where you begin to count :) ), but one of your IPs can be found out, for example, this way: boost::asio::io_service io_service; boost::asio::ip::tcp::resolver resolver(io_service); boost::asio::ip::tcp::resolver::query query(boost::asio::ip::host_name(), ""); boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(query); boost::asio::ip::address addr = iter->endpoint().address(); std::cout << addr.to_string();
5604
Age (days ago)
5604
Last active (days ago)
1 comments
2 participants
participants (2)
-
Igor R
-
Javier Estrada