I\'m currently searching for a portable way of getting the local IP-addresses. Because I\'m using Boost anyway I thought it would be a good idea to use Boost.Asio for this t
Assuming you have one network card / one local ip address:
#include namespace ip = boost::asio::ip; std::string getAddress() { boost::asio::io_service ioService; ip::tcp::resolver resolver(ioService); return resolver.resolve(ip::host_name(), "")->endpoint().address().to_string(); }